Quicksort in 5 minutes
Some time ago, I conducted a short presentation about Ruby. And to impress the audience, I did some live coding and implemented the quicksort algorithm in 5 minutes. They were impressed :)
Some time ago, I conducted a short presentation about Ruby. And to impress the audience, I did some live coding and implemented the quicksort algorithm in 5 minutes. They were impressed :)
J-_-L | November 10, 2009
- __Unwittingly, I have deleted some comments__ :/ -
One commentator pointed out that this snippet changes the base array (it removes the first element from it).
In the other comment, someone noted that the function is even faster than the built-in one on small arrays (however, far slower on not so small ones).