Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Created February 25, 2010 22:43
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 Phrogz/315124 to your computer and use it in GitHub Desktop.
Save Phrogz/315124 to your computer and use it in GitHub Desktop.
size.times do |i|
k = i
((i+1)...size).each do |j|
k=j if a[j] < a[k]
a[k],a[i] = a[i],a[k]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment