Skip to content

Instantly share code, notes, and snippets.

@dragstar328
Created April 27, 2015 02:56
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 dragstar328/498dabec05efef7f7ed7 to your computer and use it in GitHub Desktop.
Save dragstar328/498dabec05efef7f7ed7 to your computer and use it in GitHub Desktop.
アルゴリズムクイックリファレンス:選択ソート
def select_sort(target):
p = len(target)
for i in xrange(p - 1):
min = target[i]
t = i
for j in xrange(i + 1, p):
if target[j] < min:
min = target[j]
t = j
target[t] = target[i]
target[i] = min
return target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment