Skip to main content

The Number of Symbol Comparisons in QuickSort and QuickSelect

  • Conference paper
Automata, Languages and Programming (ICALP 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5555))

Included in the following conference series:

Abstract

We revisit the classical QuickSort and QuickSelect algorithms, under a complexity model that fully takes into account the elementary comparisons between symbols composing the records to be processed. Our probabilistic models belong to a broad category of information sources that encompasses memoryless (i.e., independent-symbols) and Markov sources, as well as many unbounded-correlation sources. We establish that, under our conditions, the average-case complexity of QuickSort is O(nlog2 n) [rather than O(nlogn), classically], whereas that of QuickSelect remains O(n). Explicit expressions for the implied constants are provided by our combinatorial–analytic methods.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Baladi, V., Vallée, B.: Euclidean algorithms are Gaussian. Journal of Number Theory 110, 331–386 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  2. Baladi, V., Vallée, B.: Exponential decay of correlations for surface semi-flows without finite Markov partitions. In: Proc. AMS 133, vol. 3, pp. 865–874 (2005)

    Google Scholar 

  3. Clément, J., Flajolet, P., Vallée, B.: Dynamical sources in information theory: A general analysis of trie structures. Algorithmica 29(1/2), 307–369 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  4. Dolgopyat, D.: On decay of correlations in Anosov flows. Annals of Mathematics 147, 357–390 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  5. Dolgopyat, D.: Prevalence of rapid mixing (I). Ergodic Theory and Dynamical Systems 18, 1097–1114 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  6. Delange, H.: Généralisation du théorème de Ikehara. Annales scientifiques de l’École Normale Supérieure Sér. 3, 71(3), 213–142 (1954)

    Google Scholar 

  7. 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 (SODA 2004), pp. 293–300 (2001)

    Google Scholar 

  8. Fill, J.A., Nakama, T.: Analysis of the expected number of bit comparisons required by Quickselect. Algorithmica, ArXiv:0706.2437 (to appear), Extended abstract in Proceedings ANALCO, pp. 249–256. SIAM Press (2008)

    Google Scholar 

  9. Flajolet, P., Sedgewick, R.: Mellin transforms and asymptotics: finite differences and Rice’s integrals. Theoretical Comp. Sc. 144, 101–124 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  10. Flajolet, P., Sedgewick, R.: Analytic Combinatorics. Cambridge University Press, Cambridge (2009); available electronically from the authors’ home pages

    Google Scholar 

  11. Grabner, P., Prodinger, H.: On a constant arising in the analysis of bit comparisons in Quickselect. Quaestiones Mathematicae 31, 303–306 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  12. Kirschenhofer, P., Prodinger, H., Martínez, C.: Analysis of Hoare’s FIND Algorithm. Random Structures & Algorithms 10, 143–156 (1997)

    Article  MathSciNet  MATH  Google Scholar 

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

    MATH  Google Scholar 

  14. Nörlund, N.E.: Leçons sur les équations linéaires aux différences finies. Gauthier-Villars, Paris (1929)

    Google Scholar 

  15. Nörlund, N.E.: Vorlesungen über Differenzenrechnung. Chelsea Publishing Company, New York (1954)

    Google Scholar 

  16. Sedgewick, R.: Quicksort. Garland Pub. Co., New York (1980); Reprint of Ph.D. thesis, Stanford University (1975)

    Google Scholar 

  17. Sedgewick, R.: Algorithms in C, Parts 1–4, 3rd edn., pp. 1–4. Addison-Wesley, Reading (1998)

    Google Scholar 

  18. Szpankowski, W.: Average-Case Analysis of Algorithms on Sequences. John Wiley, Chichester (2001)

    Book  MATH  Google Scholar 

  19. Vallée, B.: Dynamical sources in information theory: Fundamental intervals and word prefixes. Algorithmica 29(1/2), 262–306 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  20. Vallée, B.: Euclidean dynamics. Discrete and Continuous Dynamical Systems 15(1), 281–352 (2006)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Vallée, B., Clément, J., Fill, J.A., Flajolet, P. (2009). The Number of Symbol Comparisons in QuickSort and QuickSelect. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds) Automata, Languages and Programming. ICALP 2009. Lecture Notes in Computer Science, vol 5555. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-02927-1_62

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-02927-1_62

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-02926-4

  • Online ISBN: 978-3-642-02927-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics