Analysis of the Expected Number of Bit Comparisons Required by Quickselect

When algorithms for sorting and searching are applied to keys that are represented as bit strings, we can quantify the performance of the algorithms not only in terms of the number of key comparisons required by the algorithms but also in terms of the number of bit comparisons. Some of the standard sorting and searching algorithms have been analyzed with respect to key comparisons but not with respect to bit comparisons. In this paper, we investigate the expected number of bit comparisons required by Quickselect (also known as Find). We develop exact and asymptotic formulae for the expected number of bit comparisons required to find the smallest or largest key by Quickselect and show that the expectation is asymptotically linear with respect to the number of keys. Similar results are obtained for the average case. For finding keys of arbitrary rank, we derive an exact formula for the expected number of bit comparisons that (using rational arithmetic) requires only finite summation (rather than such operations as numerical integration) and use it to compute the expectation for each target rank.

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

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

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

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

[5]  Donald E. Knuth,et al.  Mathematical Analysis of Algorithms , 1971, IFIP Congress.

[6]  M. V. Wilkes,et al.  The Art of Computer Programming, Volume 3, Sorting and Searching , 1974 .

[7]  Donald E. Knuth,et al.  The art of computer programming: V.1.: Fundamental algorithms , 1997 .

[8]  Mireille Régnier A Limiting Distribution for Quicksort , 1989, RAIRO Theor. Informatics Appl..

[9]  U. Rösler A limit theorem for "Quicksort" , 1991, RAIRO Theor. Informatics Appl..

[10]  Helmut Prodinger,et al.  Mellin Transforms and Asymptotics: Digital Sums , 1994, Theor. Comput. Sci..

[11]  Helmut Prodinger,et al.  Multiple Quickselect - Hoare's Find Algorithm for Several Elements , 1995, Inf. Process. Lett..

[12]  Hosam M. Mahmoud,et al.  Analysis of Quickselect: An Algorithm for Order Statistics , 1995, RAIRO Theor. Informatics Appl..

[13]  Philippe Flajolet,et al.  Mellin Transforms and Asymptotics: Finite Differences and Rice's Integrals , 1995, Theor. Comput. Sci..

[14]  H. Mahmoud,et al.  Average-case analysis of multiple Quickselect: An algorithm for finding order statistics , 1996 .

[15]  Hosam M. Mahmoud,et al.  Probabilistic Analysis of MULTIPLE QUICK SELECT , 1998, Algorithmica.

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

[17]  Wojciech Szpankowski,et al.  Quicksort Algorithm Again Revisited , 1999, Discret. Math. Theor. Comput. Sci..

[18]  Luc Devroye,et al.  ON THE PROBABILISTIC WORST-CASE TIME OF “FIND” , 2001 .

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

[20]  Ludger Rüschendorf,et al.  Rates of convergence for Quicksort , 2002, J. Algorithms.

[21]  Svante Janson,et al.  Quicksort asymptotics , 2002, J. Algorithms.

[22]  Rudolf Grübel,et al.  Asymptotic distribution theory for Hoare's selection algorithm , 1996, Advances in Applied Probability.

[23]  Svante Janson,et al.  The number of bit comparisons used by Quicksort: an average-case analysis , 2004, SODA '04.

[24]  Helmut Prodinger,et al.  On a Constant Arising in the Analysis of Bit Comparisons in Quickselect , 2008 .

[25]  James Allen Fill,et al.  Analysis of the Expected Number of Bit Comparisons Required by Quickselect , 2008, ANALCO.

[26]  Philippe Flajolet,et al.  The Number of Symbol Comparisons in QuickSort and QuickSelect , 2009, ICALP.