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...
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...