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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Baladi, V., Vallée, B.: Euclidean algorithms are Gaussian. Journal of Number Theory 110, 331–386 (2005)
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)
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)
Dolgopyat, D.: On decay of correlations in Anosov flows. Annals of Mathematics 147, 357–390 (1998)
Dolgopyat, D.: Prevalence of rapid mixing (I). Ergodic Theory and Dynamical Systems 18, 1097–1114 (1998)
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)
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)
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)
Flajolet, P., Sedgewick, R.: Mellin transforms and asymptotics: finite differences and Rice’s integrals. Theoretical Comp. Sc. 144, 101–124 (1995)
Flajolet, P., Sedgewick, R.: Analytic Combinatorics. Cambridge University Press, Cambridge (2009); available electronically from the authors’ home pages
Grabner, P., Prodinger, H.: On a constant arising in the analysis of bit comparisons in Quickselect. Quaestiones Mathematicae 31, 303–306 (2008)
Kirschenhofer, P., Prodinger, H., Martínez, C.: Analysis of Hoare’s FIND Algorithm. Random Structures & Algorithms 10, 143–156 (1997)
Knuth, D.E.: The Art of Computer Programming, 2nd edn. Sorting and Searching, vol. 3. Addison-Wesley, Reading (1998)
Nörlund, N.E.: Leçons sur les équations linéaires aux différences finies. Gauthier-Villars, Paris (1929)
Nörlund, N.E.: Vorlesungen über Differenzenrechnung. Chelsea Publishing Company, New York (1954)
Sedgewick, R.: Quicksort. Garland Pub. Co., New York (1980); Reprint of Ph.D. thesis, Stanford University (1975)
Sedgewick, R.: Algorithms in C, Parts 1–4, 3rd edn., pp. 1–4. Addison-Wesley, Reading (1998)
Szpankowski, W.: Average-Case Analysis of Algorithms on Sequences. John Wiley, Chichester (2001)
Vallée, B.: Dynamical sources in information theory: Fundamental intervals and word prefixes. Algorithmica 29(1/2), 262–306 (2001)
Vallée, B.: Euclidean dynamics. Discrete and Continuous Dynamical Systems 15(1), 281–352 (2006)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)