Re:Why don't they just..?
by dpark on Monday August 20, 2012 @12:07PM
(#4408228)
That depends on the pivot chosen. If your quicksort implementation actually hits n^2 behavior with sorted input, it's probably not the best implementation.
Any implementation can hit n^2 with random input. It's just highly unlikely.
Re:Why don't they just..?
by eru on Tuesday August 21, 2012 @04:21AM
(#4411683)
Yes, I know. That's what the "easily avoidable" was for. I couldn't think of a better example in a few minutes, but if something can go wrong, I am sure it will eventually go wrong.
Any implementation can hit n^2 with random input. It's just highly unlikely.