Randomized selection with tripartitioning

We show that several versions of Floyd and Rivest’s algorithm Select [Comm. ACM 18 (1975) 173] for finding the kth 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 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.

[1]  Uri Zwick,et al.  On Lower Bounds for Selecting the Median , 2001, SIAM J. Discret. Math..

[2]  J. Ian Munro,et al.  Average case selection , 1989, JACM.

[3]  Vasek Chvátal,et al.  The tail of the hypergeometric distribution , 1979, Discret. Math..

[4]  C. SIAMJ. OPTIMAL SAMPLING STRATEGIES IN QUICKSORT AND QUICKSELECT , 2001 .

[5]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .

[6]  R. W. Floyd,et al.  Algorithm 489: the algorithm SELECT—for finding the ith smallest of n elements [M1] , 1975, CACM.

[7]  Rudolf Grübel On the median-of-K version of Hoare's selection algorithm , 1999, RAIRO Theor. Informatics Appl..

[8]  C. A. R. Hoare,et al.  Algorithm 65: find , 1961, Commun. ACM.

[9]  Jon Louis Bentley,et al.  Engineering a sort function , 1993, Softw. Pract. Exp..

[10]  Theodore Brown Remark on “Algorithm 489: The Algorithm SELECT—for Finding the ith Smallest of n Elements [M1]” , 1976, TOMS.

[11]  Ronald L. Rivest,et al.  The Algorithm SELECT - for Finding the ith Smallest of n Elements [M1] (Algorithm 489) , 1975, Commun. ACM.

[12]  Uri Zwick,et al.  Selecting the median , 1995, SODA '95.

[13]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[14]  Krzysztof C. Kiwiel,et al.  Partitioning schemes for quicksort and quickselect , 2003, ArXiv.

[15]  W. Hoeffding Probability Inequalities for sums of Bounded Random Variables , 1963 .

[16]  Helmut Prodinger,et al.  Analysis of Hoare's FIND algorithm with Median-of-three partition , 1997, Random Struct. Algorithms.

[17]  David R. Musser Introspective Sorting and Selection Algorithms , 1997 .

[18]  Manuel Blum,et al.  Time Bounds for Selection , 1973, J. Comput. Syst. Sci..

[19]  John D. Valois Introspective sorting and selection revisited , 2000 .

[20]  Arnold Schönhage,et al.  Finding the Median , 1976, J. Comput. Syst. Sci..

[21]  Alexander H. G. Rinnooy Kan,et al.  An efficient dynamic selection method , 1983, CACM.