Skip to main content
Log in

On the distribution of comparisons in sorting algorithms

  • Part I Computer Science
  • Published:
BIT Numerical Mathematics Aims and scope Submit manuscript

Abstract

We considered the following natural conjecture: For every sorting algorithm every key will be involved inΩ(logn) comparisons for some input. We show that this is true for most of the keys and prove matching upper and lower bounds. Every sorting algorithm for some input will involvenn ε/2+1 keys in at leastεlog2 n comparisons,ε>0. Further, there exists a sorting algorithm that will for every input involve at mostnn ε/c keys in greater thanεlog2 n comparisons, wherec is a constant andε>0. The conjecture is shown to hold for “natural” algorithms from the literature.

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.

Institutional subscriptions

Similar content being viewed by others

References

  1. M. Ajtai, J. Komlos, and E. Szemeredi,An O(n log n) sorting network, Proc. 15th ACM Symp. Theory of Computation, 1983, pp. 1–9.

  2. M. Atallah and S. Kosaraju,An adversary-based lower bound for sorting, Info. Proc. Let., 13, 1981, pp. 55–57.

    Google Scholar 

  3. A. Borodin, L. J. Guibas, N. A. Lynch, and A. C. Yao,Efficient searching using partial ordering, Info. Proc. Let., 12, 1981, pp. 71–75.

    Google Scholar 

  4. F. Fussenegger and H. Gabow,A counting approach to lower bounds for selection problems, J. ACM, 26, 1979, pp. 227–238.

    Google Scholar 

  5. J. R. Griggs,Poset measure and saturated partitions, Studies in Applied Math., 66, 1982, pp. 91–93.

    Google Scholar 

  6. D. E. Knuth,The Art of Computer Programming: Fundamental Algorithms, Addison-Wesley, 1968.

  7. D. E. Knuth,The Art of Computer Programming: Sorting and Searching, Addison-Wesley, 1973.

  8. D. S. Richards,Problems in Sorting and Graph Algorithms, UIUCDCS-R-84-1186, Ph.D. Thesis, University of Illinois, 1984.

  9. D. S. Richards,Sorting with expensive comparands, International Journal of Computer Mathematics, 16, 1984, pp. 23–45.

    Google Scholar 

  10. M. Saks,The information theoretic bound for problems on ordered sets and graphs, inGraphs and Orders, I. Rival (ed.), Reidel, 1985, 137–168.

  11. H. Wilf,Some examples of combinatorial averaging, Am. Math. Monthly, 92, 1985, pp. 250–261.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Richards, D., Vaidya, P. On the distribution of comparisons in sorting algorithms. BIT 28, 764–774 (1988). https://doi.org/10.1007/BF01954896

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

CR categories

Keywords

Navigation