Partitioning schemes for quicksort and quickselect

We introduce several modifications of the partitioning schemes used in Hoare’s quicksort and quickselect algorithms, including ternary schemes which identify keys less or greater than the pivot. We give estimates for the numbers of swaps made by each scheme. Our computational experiments indicate that ternary schemes allow quickselect to identify all keys equal to the selected key at little additional cost.

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

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

[3]  Hsien-Kuei Hwang,et al.  Quickselect and the Dickman Function , 2002, Combinatorics, Probability and Computing.

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

[5]  Robert Sedgewick,et al.  Fast algorithms for sorting and searching strings , 1997, SODA '97.

[6]  Hsien-Kuei Hwang,et al.  An asymptotic theory for Cauchy-Euler differential equations with applications to the analysis of algorithms , 2002, J. Algorithms.

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

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

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

[10]  Lutz M. Wegner Quicksort for Equal Keys , 1985, IEEE Transactions on Computers.

[11]  Marianne Durand,et al.  Asymptotic analysis of an optimized quicksort algorithm , 2003, Inf. Process. Lett..

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

[13]  Conrado Martínez Parra,et al.  Optimal sampling strategies in quicksort and quickselect , 1998 .

[14]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

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

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

[17]  Robert Sedgewick,et al.  Implementing Quicksort programs , 1978, CACM.

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

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

[20]  Robert Sedgewick,et al.  Algorithms in C - parts 1-4: fundamentals, data structures, sorting, searching (3. ed.) , 1997 .

[21]  Robert Sedgewick,et al.  Algorithms in C++, Parts 1-4: Fundamentals, Data Structure, Sorting, Searching, Third Edition , 1998 .