Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Array
- def quick_sort
- h, *t = self
- h ? t.partition {|e| e < h}.inject {|l, r| l.quick_sort + [h] + r.quick_sort} : []
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement