Skip to main content
Log in

Analysis of the Expected Number of Bit Comparisons Required by Quickselect

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Devroye, L.: On the probablistic worst-case time of “Find”. Algorithmica 31, 291–303 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  2. Fill, J.A., Janson, S.: Quicksort asymptotics. J. Algorithms 44, 4–28 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  3. Fill, J.A., Janson, S.: The number of bit comparisons used by Quicksort: An average-case analysis. In: Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pp. 293–300 (2004)

  4. Flajolet, P., Grabner, P., Kirschenhofer, P., Prodinger, H., Tichy, R.F.: Mellin transforms and asymptotics: digital sums. Theor. Comput. Sci. 123, 291–314 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  5. Flajolet, P., Sedgewick, R.: Mellin transforms and asymptotics: Finite differences and Rice’s integrals. Theor. Comput. Sci. 144, 101–124 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  6. Grabner, P.J., Prodinger, H.: On a constant arising in the analysis of bit comparisons in Quickselect. Quaest. Math. 31, 303–306 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  7. Grübel, R., Rösler, U.: Asymptotic distribution theory for Hoare’s selection algorithm. Adv. Appl. Probab. 28, 252–269 (1996)

    Article  MATH  Google Scholar 

  8. Hoare, C.R.: Find (algorithm 65). Commun. ACM 4, 321–322 (1961)

    Article  Google Scholar 

  9. Hwang, H., Tsai, T.: Quickselect and the Dickman function. Comb. Probab. Comput. 11, 353–371 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  10. Knessl, C., Szpankowski, W.: Quicksort algorithm again revisited. Discrete Math. Theor. Comput. Sci. 3, 43–64 (1999)

    MATH  Google Scholar 

  11. Knuth, D.E.: Mathematical analysis of algorithms. In: Information Processing 71, Proceedings of IFIP Congress, Ljubljana, 1971, pp. 19–27. North-Holland, Amsterdam (1972)

    Google Scholar 

  12. Knuth, D.E.: The Art of Computer Programming. Fundamental Algorithms, vol. 1. Addison-Wesley, Reading (1998)

    Google Scholar 

  13. Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3. Addison-Wesley, Reading (1998)

    Google Scholar 

  14. Lent, J., Mahmoud, H.M.: Average-case analysis of multiple Quickselect: An algorithm for finding order statistics. Stat. Probab. Lett. 28, 299–310 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  15. Mahmoud, H.M., Modarres, R., Smythe, R.T.: Analysis of Quickselect: An algorithm for order statistics. RAIRO Inform. Théor. Appl. 29, 255–276 (1995)

    MATH  MathSciNet  Google Scholar 

  16. Mahmoud, H.M., Smythe, R.T.: Probabilistic analysis of multiple Quickselect. Algorithmica 22, 569–584 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  17. Neininger, R., Rüschendorf, L.: Rates of convergence for Quickselect. J. Algorithms 44, 51–62 (2002)

    Article  MathSciNet  Google Scholar 

  18. Prodinger, H.: Multiple Quickselect—Hoare’s Find algorithm for several elements. Inf. Process. Lett. 56, 123–129 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  19. Régnier, M.: A limiting distribution of Quicksort. RAIRO Inform. Théor. Appl. 23, 335–343 (1989)

    MATH  MathSciNet  Google Scholar 

  20. Rösler, U.: A limit theorem for Quicksort. RAIRO Inform. Théor. Appl. 25, 85–100 (1991)

    MATH  MathSciNet  Google Scholar 

  21. Vallée, B., Clément, J., Fill, J.A., Flajolet, P.: The number of symbol comparisons in Quicksort and Quickselect. Preprint (2009)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to James Allen Fill.

Additional information

Research for both authors supported by NSF grant DMS–0406104, and by The Johns Hopkins University’s Acheson J. Duncan Fund for the Advancement of Research in Statistics.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Fill, J.A., Nakama, T. Analysis of the Expected Number of Bit Comparisons Required by Quickselect. Algorithmica 58, 730–769 (2010). https://doi.org/10.1007/s00453-009-9294-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-009-9294-3

Keywords

Navigation