We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7daf96 commit 7f5e620Copy full SHA for 7f5e620
selection_sort.py
@@ -0,0 +1,11 @@
1
+def selection_sort(s):
2
+ k = 0
3
+ for i in range(len(s)):
4
+ k = i
5
+ for j in range(i+1, len(s)-1):
6
+ if s[j] < s[k]:
7
+ k = j
8
+ temp = s[i]
9
+ s[i] = s[k]
10
+ s[k] = temp
11
+ return s
0 commit comments