Randomized selection with quintary partitions

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]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

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

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

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

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

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

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

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

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

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

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

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

[13]  Russ Bubley,et al.  Randomized algorithms , 1995, CSUR.

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

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

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

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

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

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

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

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

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

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

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

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

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

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