News for hackers. Stuff that matters.
Re:Potential Quicksort replacement in java.util.Arrays with ... by gjm11 on Friday September 11, 2009 @02:09PM (#817791)
You can make a quicksortish sort algorithm with N log N worst case by letting the number of pivots increase with N. (Details and proof, of course, in Knuth. The details are nontrivial but not all that painful.) I don't think anyone's ever proposed that that's worth doing in practice.

Using more pivots is going to make the code more complicated. The benefits of moving from one pivot to two seem to be real but not enormous; I'd be pretty surprised if moving to three pivots produced benefits worth the cost. But of course that's just handwaving, and indeed it would be interesting to measure.

Re:Potential Quicksort replacement in java.util.Arrays with ... by fhars on Saturday September 12, 2009 @03:41AM (#818739)
My copy of Knuth does only mention that algorithm with a reference to a 1970 paper.

But what I woukd find more intereting is how the parallelizable Batcher and Pratt algorithms decsribed by Knuth fare on modern multicore machines with their weird cache hierarchies.