Randomized selection with tripartitioning
Abstract
We show that several versions of Floyd and Rivest's algorithm Select [Comm.\ ACM {\bf 18} (1975) 173] for finding the $k$th smallest of $n$ elements require at most $n+\min\{k,n-k\}+o(n)$ comparisons on average, even when equal elements occur. This parallels our recent analysis of another variant due to Floyd and Rivest [Comm. ACM {\bf 18} (1975) 165--172]. Our computational results suggest that both variants perform well in practice, and may compete with other selection methods, such as Hoare's Find or quickselect with median-of-3 pivots.
- Publication:
-
arXiv e-prints
- Pub Date:
- January 2004
- DOI:
- 10.48550/arXiv.cs/0401003
- arXiv:
- arXiv:cs/0401003
- Bibcode:
- 2004cs........1003K
- Keywords:
-
- Data Structures and Algorithms;
- F.2.2;
- G3
- E-Print:
- 19 pages