Skip to main content
Log in

Transitional behaviors of the average cost of quicksort with median-of-(2t + 1)

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

A fine analysis is given of the transitional behavior of the average cost of quicksort with median-of-three. Asymptotic formulae are derived for the stepwise improvement of the average cost of quicksort when iterating median-of-threek rounds for all possible values ofk. The methods used are general enough to apply to quicksort with median-of-(2t + 1) and to explain in a precise manner the transitional behaviors of the average cost from insertion sort to quicksort proper. Our results also imply nontrivial bounds on the expected height, “saturation level,” and width in a random locally balanced binary search tree.

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. N. Bleistein and R. A. Handelsman,Asymptotic Expansions of Integrals, Dover, New York, 1985.

    Google Scholar 

  2. H. E. Daniels, Tail probability approximations,International Statistical Review,55, 37–48.

  3. L. Devroye, On the expected height of fringe-balanced trees,Acta Informatica,30, 459–466, 1993.

    Article  MATH  MathSciNet  Google Scholar 

  4. P. Flajolet and A. M. Odlyzko, Singularity analysis of generating function,SIAM Journal on Discrete Mathematics,3, 216–240, 1990.

    Article  MATH  MathSciNet  Google Scholar 

  5. G. H. Gonnet and R. Baeza-Yates,Handbook of Algorithms and Data Structures, second edition, Addison-Wesley, Reading, Massachusetts, 1991.

    Google Scholar 

  6. D. H. Greene, Labelled formal languages and their uses, Ph.D. Thesis, Stanford University, 1983.

  7. L. J. Guibas, A principle of independence for binary tree searching,Acta Informatica,4, 293–298, 1975.

    Article  MATH  MathSciNet  Google Scholar 

  8. P. Hennequin, Combinatorial analysis of quicksort algorithm,RAIRO Informatique théorique et Applications,23, 317–333, 1989.

    MATH  MathSciNet  Google Scholar 

  9. P. Hennequin, Analyse en moyenne d’algorithmes, tri rapide et arbres de recherche, Ph.D. Thesis, Ecole Polytechnique, 1991.

  10. C. A. R. Hoare, Quicksort,Computer Journal,5, 10–15, 1962.

    Article  MATH  MathSciNet  Google Scholar 

  11. H.-K. Hwang, A Possion * negative binomial convolution law for random polynomials over finite fields,Random Structures and Algorithms,13, 17–47, 1998.

    Article  MATH  MathSciNet  Google Scholar 

  12. H.-K. Hwang, Sur la répartition des valeurs des fonctions arithmétiques: le nombre de facteurs premiers d’un entier,Journal of Number Theory,69, 135–152, 1998.

    Article  MATH  MathSciNet  Google Scholar 

  13. H.-K. Hwang, B.-Y. Yang, and Y.-N. Yeh, Presorting algorithms: an average-case point of view,Theoretical Computer Science,242, 29–40, 2000.

    Article  MATH  MathSciNet  Google Scholar 

  14. E. L. Ince,Ordinary Differential Equations, Dover, New York, 1926.

    Google Scholar 

  15. D. E. Knuth,The Art of Computer Programming, Volume III: Sorting and Searching, second edition, Addison-Wesley, Reading, Massachusetts, 1998.

    Google Scholar 

  16. Ľ. Kollár, Optimal sorting of seven element sets,Mathematical Foundations of Computer Science (Bratislave, 1986), Lecture Notes in Computer Science, Vol. 233, No. 449–457, Springer-Verlag, Berlin, 1986.

    Google Scholar 

  17. R. Lugannani and S. O. Rice, Saddlepoint approximation for the distribution of the sum of independent random variables,Advances in Applied Probability,12, 475–490, 1980.

    Article  MATH  MathSciNet  Google Scholar 

  18. H. M. Mahmoud,Evolution of Random Search Trees, Wiley, New York, 1992.

    MATH  Google Scholar 

  19. C. Martínez, A. Panholzer, and H. Prodinger, On the number of descendants and ascendants in random search trees,Electronic Journal on Combinatorics,5, # R20, 1998.

  20. C. Martínez and S. Roura, Optimal sampling strategies in quicksort,Automata, Languages, and Programming (Aalborg, 1998). Lecture Notes in Computer Science, Vol. 1443, pp. 327–338, Springer-Verlag, Berlin, 1998.

    Google Scholar 

  21. C. C. McGeoch and J. D. Tygar, Optimal sampling strategies for Quicksort,Random Structures and Algorithms,7, 287–300, 1995.

    Article  MATH  MathSciNet  Google Scholar 

  22. A. M. Odlyzko and H. S. Wilf, Bandwidths and profiles of trees,Journal of Combinatorial Theory, Series B,42, 348–370, 1987.

    Article  MATH  MathSciNet  Google Scholar 

  23. P. V. Poblete and J. I. Munro, The analysis of a fringe heuristic for binary search trees,Journal of Algorithms,6, 336–350, 1985.

    Article  MATH  MathSciNet  Google Scholar 

  24. R. Sedgewick, The analysis of Quicksort programs,Acta Informatica,7, 327–355, 1977.

    Article  MATH  MathSciNet  Google Scholar 

  25. R. Sedgewick,Quicksort, Garland, New York, 1978.

    Google Scholar 

  26. R. Sedgewick,Algorithms in C, third edition, Addison-Wesley, Reading, Massachusetts, 1997.

    MATH  Google Scholar 

  27. R. Sedgewick and P. Flajolet,An Introduction to the Analysis of Algorithms, Addison-Wesley, Reading, Massachusetts, 1996.

    MATH  Google Scholar 

  28. A. Walker and D. Wood, Locally balanced binary search trees,Computer Journal,19, 322–325, 1976.

    Article  MATH  Google Scholar 

  29. R. Wong,Asymptotic Approximations of Integrals, Academic Press, Boston, 1989.

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Communicated by H. Prodinger and W. Szpankowski.

This work was done while the first author was at the Institute of Mathematics, Academia Sinica, Taipei, Taiwan.

Online publication September 22, 2000.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Chern, H.H., Hwang, H.K. Transitional behaviors of the average cost of quicksort with median-of-(2t + 1). Algorithmica 29, 44–69 (2001). https://doi.org/10.1007/BF02679613

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02679613

Key Words

Navigation