Skip to main content
Log in

On partitions and presortedness of sequences

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

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.

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. 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. Chen, J., Carlsson, S.: Measuring presortedness and evaluating disorder. In: Fifth SIAM Conference on Discrete Mathematics, Atlanta, GA, 1990

  3. Cook, C.R., Kim, D.J.: Best sorting algorithm for nearly sorted lists. Commun. ACM23, 620–624 (1980)

    Google Scholar 

  4. Dijkstra, E.W.: Smoothsort, an alternative for sorting in situ. Sci. Comput. Program.1, 223–233 (1982)

    Google Scholar 

  5. Dilworth, R.P.: A decomposition theorem for partially ordered sets. Ann. Math.51, 161–166 (1950)

    Google Scholar 

  6. Dromey, R.G.: Exploiting partial order with quicksort. Software Pract. Exper.14, 509–518 (1984)

    Google Scholar 

  7. Estivill-Castro, V., Wood, D.: A new measure of presortedness. Inf. Comput.83, 111–119 (1989)

    Google Scholar 

  8. Hertel, S.: Smoothsort's behavior on presorted sequences. Inf. Process. Lett.16, 165–170 (1983)

    Google Scholar 

  9. Kirkpartrick, D.G., Seidel, R.: The ultimate planar convex hull algorithm? SIAM J. Comput.15, 287–299 (1986)

    Google Scholar 

  10. Knuth, D.E.: The Art of Computer Programming, Vol. 3: Sorting and Searching. Reading, M.A.: Addison-Wesley 1973

    Google Scholar 

  11. Mannila, H.: Measures of presortedness and optimal sorting algorithms. IEEE Trans. Comput.C-34, 318–325 (1985)

    Google Scholar 

  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 1979

    Google Scholar 

  13. Petersson, O.: Adaptive sorting. PhD thesis, Lund University, December, 1990

  14. Skiena, S.S.: Encroaching lists as a measure of presortedness. BIT28, 775–784 (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

The main part of the work was conducted while the author was with Lund University.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Carlsson, S., Chen, J. On partitions and presortedness of sequences. Acta Informatica 29, 267–280 (1992). https://doi.org/10.1007/BF01185681

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation