Skip to content

Instantly share code, notes, and snippets.

@bcambel
Created November 6, 2014 11:10
Show Gist options
  • Select an option

  • Save bcambel/87f80cb4d5748e57798e to your computer and use it in GitHub Desktop.

Select an option

Save bcambel/87f80cb4d5748e57798e to your computer and use it in GitHub Desktop.
Selection Sort
for i in range(len(source)):
mini = min(source[i:])
print "ITER", mini, source
min_index = source[i:].index(mini)
source[i + min_index] = source[i]
source[i] = mini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment