Skip to content

Instantly share code, notes, and snippets.

@christian-marie
Created July 17, 2013 01:51
Show Gist options
  • Save christian-marie/6017045 to your computer and use it in GitHub Desktop.
Save christian-marie/6017045 to your computer and use it in GitHub Desktop.
The most best ever quicksort, obviously Ruby. Super fast.
s=->l{(p=l.pop)?s[l.select{|i|i<=p}]+[p]+s[l.select{|i|i>p}]:[]}
puts s["the quick brown fox jumps over the lazy dog".chars.to_a].join
@christian-marie
Copy link
Author

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment