Web log of Josh Nussbaum
class Array def quicksort return self if length <= 1 pivot = shift less, greater = partition {|x| x <= pivot} less.quicksort + [pivot] + greater.quicksort endendputs [8,99,4,1000,1,2,3,100,5,6].quicksort.join(',')
Post a Comment
No comments:
Post a Comment