Re:Potential Quicksort replacement in java.util.Arrays with ...
by swac on Friday September 11, 2009 @07:48PM
(#818356)
If you determine the number of pivots when you write the algorithm, they could be sorted in constant time. It would just require a lot of if-else branching...
size = 0 -> no sort
size = 1 -> no sort
size = 2 -> pivots can be made, thus can be sorted
etc.