Skip to content

Commit b1b4bda

Browse files
Changed extention of previous files and added Selection sort
1 parent 5e3a0d4 commit b1b4bda

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Diff for: BubbleSort.python renamed to BubbleSort.py

File renamed without changes.

Diff for: InsertionSort.python renamed to InsertionSort.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
array=[];
42

53
# input

Diff for: SelectionSort.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
print ("Enter numbers seprated by comma ")
2+
def selectionsort( aList ):
3+
for i in range( len( aList ) ):
4+
least = i
5+
for k in range( i + 1 , len( aList ) ):
6+
if aList[k] < aList[least]:
7+
least = k
8+
9+
swap( aList, least, i )
10+
11+
def swap( A, x, y ):
12+
tmp = A[x]
13+
A[x] = A[y]
14+
A[y] = tmp

0 commit comments

Comments
 (0)