On Floyd and Rivest's SELECT algorithm

We show that several versions of Floyd and Rivest's algorithm SELECT for finding the kth smallest of n elements require at most n + min{k, n - k} + o (n) comparisons on average and with high probability. This rectifies the analysis of Floyd and Rivest, and extends it to the case of nondistinct elements. Our computational results confirm that SELECT may be the best algorithm in practice.

[1]  D. Dor,et al.  Median selection requires (2+/spl epsiv/)n comparisons , 1996, Proceedings of 37th Conference on Foundations of Computer Science.

[2]  Krzysztof C. Kiwiel,et al.  Improved randomized selection , 2004, ArXiv.

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

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

[5]  Uri Zwick,et al.  Median Selection Requires (2+epsilon)n Comparisons , 2001, SIAM J. Discret. Math..

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

[7]  C. A. R. Hoare,et al.  Algorithm 64: Quicksort , 1961, Commun. ACM.

[8]  Rajeev Motwani,et al.  Randomized algorithms , 1996, CSUR.

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

[10]  Krzysztof C. Kiwiel,et al.  Randomized selection with quintary partitions , 2003, ArXiv.

[11]  Ronald L. Rivest,et al.  Expected time bounds for selection , 1975, Commun. ACM.

[12]  Robert Sedgewick Quicksort with Equal Keys , 1977, SIAM J. Comput..

[13]  Donald E. Knuth,et al.  The Art of Computer Programming, Volume I: Fundamental Algorithms, 2nd Edition , 1997 .

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

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

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

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

[18]  Rüdiger Reischuk Probabilistic Parallel Algorithms for Sorting and Selection , 1985, SIAM J. Comput..

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

[20]  C. A. R. Hoare Algorithm 63: partition , 1961, CACM.

[21]  Krzysztof C. Kiwiel,et al.  Randomized selection with tripartitioning , 2004, ArXiv.

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

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

[24]  Conrado Martínez,et al.  Optimal Sampling Strategies in Quicksort and Quickselect , 2002, SIAM J. Comput..

[25]  H. Prodinger,et al.  Analysis of Hoare's FIND algorithm with median-of-three partition , 1997 .

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

[27]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

[28]  Donald E. Knuth,et al.  The art of computer programming, volume 3: (2nd ed.) sorting and searching , 1998 .

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

[30]  Alexandros V. Gerbessiotis,et al.  Randomized selection in n+C+o(n) comparisons , 2003, Inf. Process. Lett..

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

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