8 ms·
The two-pivot variant has a smaller recursion depth in addition to avoiding the multiplicitous median issue, but does come at the cost of extra swaps. But in th
by sesqu 13y ago
The two-pivot variant has a smaller recursion depth in addition to avoiding the multiplicitous median issue, but does come at the cost of extra swaps. But in the end, quickselect is what you use when you don't worry about pessimal performance.