Deterministic Selection - Select the i th smallest element
We have already seen RSelect or Random Selection here. Now lets focus on DSelect.
Though RSelect is good, and works in linear time, but it deterministically runs in O(n) time, even in worst case. But the downside is that it doesn’t runs as fast as RSelect, but its worst case is still better. Like in quicksort, we had it better than merge sort, but worst case of quicksort was worse than mergesort.
[Read More]