Measures of presortedness and optimal sorting algorithms

Extended abstract
  • Heikki Mannila
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 172)


The concept of presortedness and its use in sorting are studied. Natural ways to measure presortedness are given and some general properties necessary for a measure are proposed. A concept of a sorting algorithm optimal with respect to a measure of presortedness is defined, and examples of such algorithms are given. An insertion sort is shown to be optimal with respect to three natural measures. The problem of finding an optimal algorithm for an arbitrary measure is studied and partial results are proven.


Sorting Algorithm Natural Measure Sorting Method Input Length Arbitrary Measure 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. /Ash65/.
    R. Ash: Information theory. Interscience Publishers, 1965.Google Scholar
  2. /BrT80/.
    M.R. Brown & R.E. Tarjan: Design and analysis of a data structure for representing sorted lists. SIAM Journal on Computing 9, 3 (Aug. 1980), 594–614.Google Scholar
  3. /CoK80/.
    C.R. Cook & D.J. Kim: Best sorting algorithm for nearly sorted lists. Communications of the ACM 23, 11 (Nov. 1980), 620–624.Google Scholar
  4. /DMS82/.
    R.B.K. Dewar, S.M. Merritt & M. Sharir: Some modified algorithms for Dijkstra's longest upsequence problem. Acta Informatica 18 (1982), 1–15.Google Scholar
  5. /Dij80/.
    E.W. Dijkstra: Some beautiful arguments using mathematical induction. Acta Informatica 13 (1980), 1–13Google Scholar
  6. /Dij82/.
    E.W. Dijkstra: Smoothsort, an alternative to sorting in situ. Science of Computer Programming 1 (1982), 223–233.Google Scholar
  7. /ElS81/.
    M.H. Ellis & J.M. Steele: Fast searching of Weyl sequences using comparisons. SIAM Journal on Computing 10, 1 (Feb. 1981), 88–95.Google Scholar
  8. /Fre75/.
    M.L. Fredman: Two applications of a probabilistic search technique: sorting X+Y and building balanced search trees. In: Proceedings of the 7th Annual ACM Symposium on Theory of Computing, 1975, p. 240–244Google Scholar
  9. /Fre76/.
    M.L. Fredman: How good is the information theory bound in sorting? Theoretical Computer Science 1 (1976), 355–361.Google Scholar
  10. /GMPR77/.
    L.J. Guibas, E.M. McCreight, M.F. Plass & J.R. Roberts: A new representation of linear lists. In: Proceedings of the 9th Annual ACM Symposium on Theory of Computing, 1977, p. 49–60.Google Scholar
  11. /HPS75/.
    L.H. Harper, T.H. Payne, J.E. Savage & E. Straus: Sorting X+Y. Communications of the ACM 18, 6 (June 1975), 347–349.Google Scholar
  12. /Her83/.
    S. Hertel: Smoothsort's behaviour on presorted sequences. Information Processing Letters 16 (1983), 165–170.Google Scholar
  13. /HuM82/.
    S. Huddleston & K. Mehlhorn: A new data structure for representing sorted lists. Acta Informatica 17 (1982), 157–184.Google Scholar
  14. /Knu73/.
    D.E. Knuth: The Art of Computer Programming, Vol. III: Sorting and Searching. Addison-Wesley, 1973.Google Scholar
  15. /Kos81/.
    S.R. Kosaraju: Localized search in sorted lists. In: Proceedings of the 11th Annual ACM Conference on Theory of Computing, 1981, p. 62–69.Google Scholar
  16. /Man84/.
    H. Mannila: Measures of presortedness and optimal sorting algorithms. Report C-1984-14, Department of Computer Science, University of Helsinki, 1984.Google Scholar
  17. /Me79a/.
    K. Mehlhorn: Searching, sorting and information theory. In: Mathematical Foundations of Computer Science 1979, J. Becvar (ed.), Springer-Verlag, 1979, p. 131–145.Google Scholar
  18. /Me79b/.
    K. Mehlhorn: Sorting presorted files. In: 4th GI Conference on Theoretical Computer Science, Springer-Verlag, 1979, p. 199–212.Google Scholar
  19. /Sed75/.
    R. Sedgewick: Quicksort. Ph.D. Thesis, Stanford University, 1975.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1984

Authors and Affiliations

  • Heikki Mannila
    • 1
  1. 1.Department of Computer ScienceUniversity of HelsinkiHelsinki 25Finland

Personalised recommendations