Skip to content

Commit cbc62f7

Browse files
committed
SelectionSort.py corrected
1 parent b1f2a22 commit cbc62f7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

DataStructures/Section10/SelectionSort.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
def selection_sort(unordered_list):
2-
size_of_list = len(unordered_list) - 1
1+
def selection_sort(unsorted_list):
2+
size_of_list = len(unsorted_list) - 1
33
for i in range(size_of_list):
44
small = i
55
for j in range(i+1, size_of_list):
6-
if unordered_list[j] < unordered_list[small]:
6+
if unsorted_list[j] < unsorted_list[small]:
77
small = j
8-
temp = unordered_list[i]
9-
unordered_list[i] = unordered_list[small]
10-
unordered_list[small] = temp
8+
temp = unsorted_list[i]
9+
unsorted_list[i] = unsorted_list[small]
10+
unsorted_list[small] = temp
1111

1212

1313
a_list = [3, 2, 35, 4, 32, 94, 5, 7]

0 commit comments

Comments
 (0)