On 12/22/2009 01:16 AM, Nick Sabalausky wrote:
It's already been pointed out in a number of places that that's not
quicksort. Quicksort is in-place and doesn't use the head as the pivot.
Besides "It probably performs like a bitch" defeats the whole point of
quicksort, doesn't it? And, going along with what Andrei pointed out in
another thread, it's hard call a piece of code "beautiful" if it's either
flat-out wrong or otherwise defeats its own point.

It does however display the idea behind quicksort quite nicely: pivot, sort the larger and smaller portions of the array separately. The rest is just optimization.

Reply via email to