Created
July 4, 2019 16:38
-
-
Save tuvo1106/46a223340432e5de499b610b104b40b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def selection(l: list): | |
arr = l[::] | |
for i in range(len(arr)): | |
m = i | |
for j in range(i + 1, len(arr)): | |
if arr[j] < arr[m]: | |
m = j | |
if i != m: | |
arr[i], arr[m] = arr[m], arr[i] | |
return arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment