Skip to content

Instantly share code, notes, and snippets.

@wilcoln
Created March 10, 2018 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilcoln/b6e2253638d26737e0e983ba3c8da590 to your computer and use it in GitHub Desktop.
Save wilcoln/b6e2253638d26737e0e983ba3c8da590 to your computer and use it in GitHub Desktop.
Python Selection sort code
def selection(array):
for i in range(len(array)):
key = i
for j in range(i+1, len(array)):
if(array[key] > array[j]):
key = j
tmp = array[i]
array[i] = array[key]
array[key] = tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment