Acta Informatica

, Volume 29, Issue 3, pp 267–280 | Cite as

On partitions and presortedness of sequences

  • Svante Carlsson
  • Jingsen Chen


To take advantage of existing order in a sequence when sorting, we evaluate the quantity of this information by the minimal size of decomposition of the input sequence, particularly the minimal size of chain and of monotonic partitions. Some sorting strategies that are optimal with respect to these measures of presortedness are presented. The relationships between these new measures of presortedness and other known measures have also been explored. As an application, we carry out the optimality of an adaptive sorting algorithm Skiena'sMelsort. For some special partitioning strategies, we present two sorting algorithms based on Dijkstra'sSmoothsort. Moreover, the optimalities of these two algorithms are demonstrated. By examining the optimalities of sorting algorithms with respect to certain measures of presortedness, we also propose some optimal sorting strategies for one class of measures. Finally, we discuss other types of sorting problems, such as sorting multisets and topological sorting. In particular, we derive an optimal algorithm for sorting multisets and for finding the multiset sizes as well.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Brandstädt, A., Kratsch, D.: On partitions of permutations into increasing and decreasing subsequences. J. Inf. Process. Cybern.22, 263–273 (1986)Google Scholar
  2. 2.
    Chen, J., Carlsson, S.: Measuring presortedness and evaluating disorder. In: Fifth SIAM Conference on Discrete Mathematics, Atlanta, GA, 1990Google Scholar
  3. 3.
    Cook, C.R., Kim, D.J.: Best sorting algorithm for nearly sorted lists. Commun. ACM23, 620–624 (1980)Google Scholar
  4. 4.
    Dijkstra, E.W.: Smoothsort, an alternative for sorting in situ. Sci. Comput. Program.1, 223–233 (1982)Google Scholar
  5. 5.
    Dilworth, R.P.: A decomposition theorem for partially ordered sets. Ann. Math.51, 161–166 (1950)Google Scholar
  6. 6.
    Dromey, R.G.: Exploiting partial order with quicksort. Software Pract. Exper.14, 509–518 (1984)Google Scholar
  7. 7.
    Estivill-Castro, V., Wood, D.: A new measure of presortedness. Inf. Comput.83, 111–119 (1989)Google Scholar
  8. 8.
    Hertel, S.: Smoothsort's behavior on presorted sequences. Inf. Process. Lett.16, 165–170 (1983)Google Scholar
  9. 9.
    Kirkpartrick, D.G., Seidel, R.: The ultimate planar convex hull algorithm? SIAM J. Comput.15, 287–299 (1986)Google Scholar
  10. 10.
    Knuth, D.E.: The Art of Computer Programming, Vol. 3: Sorting and Searching. Reading, M.A.: Addison-Wesley 1973Google Scholar
  11. 11.
    Mannila, H.: Measures of presortedness and optimal sorting algorithms. IEEE Trans. Comput.C-34, 318–325 (1985)Google Scholar
  12. 12.
    Mehlhorn, K.: Sorting presorted files. In: Weihrauch, K. (ed.) Theoretical Computer Science. Proceedings, Aachen 1979. (Lect. Notes Comput. Sci., Vol. 67, pp. 199–212) Berlin Heidelberg New York: Springer 1979Google Scholar
  13. 13.
    Petersson, O.: Adaptive sorting. PhD thesis, Lund University, December, 1990Google Scholar
  14. 14.
    Skiena, S.S.: Encroaching lists as a measure of presortedness. BIT28, 775–784 (1988)Google Scholar

Copyright information

© Springer-Verlag 1992

Authors and Affiliations

  • Svante Carlsson
    • 1
    • 2
  • Jingsen Chen
    • 1
    • 2
  1. 1.Division of Computer Science and EngineeringLuleå University of TechnologyLuleåSweden
  2. 2.Department of Computer ScienceLund UniversityLundSweden

Personalised recommendations