BIT Numerical Mathematics

, Volume 28, Issue 4, pp 775–784 | Cite as

Encroaching lists as a measure of presortedness

  • Steven S. Skiena
Part I Computer Science


Encroaching lists are a generalization of monotone sequences in permutations. Since ordered permutations contain fewer encroaching lists than random ones, the number of such listsm provides a measure of presortedness with advantages over others in the literature. Experimental and analytic results are presented to cast light on the properties of encroaching lists. Also, we describe a new sorting algorithm,melsort, with complexityO(nlogm). Thus it is linear for well ordered sets and reduces to mergesort andO(nlogn) in the worst case.

CR category


AMS category



sorting presortedness encroaching lists melsort permutations 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    D. Knuth, The Art of Computer Programming, Vol. 3: Searching and Sorting. Addison-Wesley Publishing Co., Reading, MA, 1973.Google Scholar
  2. 2.
    C. Schensted,Longest increasing and decreasing subsequences, Canadian J. Math. (1961), Vol. 13, pp. 179–191.Google Scholar
  3. 3.
    B. F. Logan and L. A. Shepp,A variational problem for random Young tableaux, Advances in Mathematics (1977), Vol. 26, pp. 206–222.Google Scholar
  4. 4.
    A. M. Versik and S. V. Kerov,Asymptotics of the Plancherel measure of the symmetric group and the limiting form of Young tables, Dokl. Akad. Nauk SSSR (1977), Vol. 233, pp. 1024–1028.Google Scholar
  5. 5.
    J. L. Bentley, H. T. Kung, M. Schkolnick, and C. D. Thompson,On the average number of maxima in a set of vectors and applications, J. ACM (1978), Vol. 25, pp. 536–543.Google Scholar
  6. 6.
    E. E. Lindstrom, J. S. Vitter, and C. K. Wong,Sorting, IEEE Trans. on Computers (April 1985), Vol. C-34, pp. 293–295.Google Scholar
  7. 7.
    E. Dijkstra,Smoothsort, an alternative for sorting in situ, Science of Computer Programming (1982), Vol. 1, pp. 223–233.Google Scholar
  8. 8.
    S. Hertel,Smoothsort's behavior on presorted sequences, Info. Processing Letters (13 May 1983), Vol. 16, pp. 165–170.Google Scholar
  9. 9.
    C. Cook and D. Kim,Best sorting algorithm for nearly sorted lists, CACM (November 1980), Vol. 23, pp. 620–624.Google Scholar
  10. 10.
    K. Mehlhorn,Sorting presorted files, In:Lect. Notes in Computer Science V. 67, K. Weihrauch, ed., Springer, Berlin, 1979, pp. 199–212.Google Scholar
  11. 11.
    H. Mannila,Measures of presortedness and optimal sorting algorithms, IEEE Trans. on Computers (April 1985), Vol. C-34, pp. 318–325.Google Scholar
  12. 12.
    R. L. Wainwright,A class of sorting algorithms based on quicksort, CACM (April 1985), Vol. 28, pp. 396–402.Google Scholar

Copyright information

© BIT Foundations 1988

Authors and Affiliations

  • Steven S. Skiena
    • 1
  1. 1.Department of Computer ScienceUniversity of IllinoisUrbanaUSA

Personalised recommendations