Skip to main content

Splitsort—an adaptive sorting algorithm

  • Communications
  • Conference paper
  • First Online:
Book cover Mathematical Foundations of Computer Science 1990 (MFCS 1990)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 452))

Abstract

We present a new sorting algorithm, called Splitsort which adapts to existing order within the input sequence. The algorithm is optimal with respect to several known measures of presortedness, including the number of inversions, for which no such simple and space efficient algorithm was known before. The amount of extra space needed is only n + O(log n) pointers. Splitsort uses a simple data structure and is easy to code. In the worst case Splitsort performs 2.5 n log2 n comparisons, but if the input is presorted according to some of the measures it completes the sorting task considerably faster. We also show how a variant of the algorithm can be implemented to run in-place.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S. Carlsson, C. Levcopoulos, and O. Petersson. Sublinear merging and Natural Merge Sort. In Proc. SIGAL Int. Symp. on Algorithms. LNCS, Springer-Verlag, 1990. To appear.

    Google Scholar 

  2. C.R. Cook and D.J. Kim. Best sorting algorithms for nearly sorted lists. Communications of the ACM, 23(11):620–624, 1980.

    Google Scholar 

  3. V. Estivill-Castro and D. Wood. A new measure of presortedness. Information and Computation, 83(1):111–119, 1989.

    Google Scholar 

  4. L.J. Guibas, E.M. McCreight, M.F. Plass, and J.R. Roberts. A new representation of linear lists. In Proc. 9th Annual ACM Symposium on Theory of Computing, pages 49–60, 1977.

    Google Scholar 

  5. B-C. Huang and M.A. Langston. Practical in-place merging. CACM, 31(3):348–352, 1988.

    Google Scholar 

  6. C. Levcopoulos and O. Petersson. Heapsort—adapted for presorted files. In Proc. 1989 WADS, pages 499–509. LNCS 382, Springer-Verlag, 1989.

    Google Scholar 

  7. C. Levcopoulos and O. Petersson. Sorting shuffled monotone sequences. In Proc. 2nd SWAT. LNCS, Springer-Verlag, 1990. To appear.

    Google Scholar 

  8. H. Mannila. Measures of presortedness and optimal sorting algorithms. IEEE Transactions on Computers, C-34(4):318–325, 1985.

    Google Scholar 

  9. K. Mehlhorn. Data Structures and Algorithms, Vol 1: Sorting and Searching. 1984.

    Google Scholar 

  10. S.S. Skiena. Encroaching lists as a measure of presortedness. BIT, 28(4):775–784, 1988.

    Google Scholar 

  11. R.L. Wainwright. A class of sorting algorithms based on Quicksort. CACM, 28(4):396–402, 1985.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Branislav Rovan

Rights and permissions

Reprints and permissions

Copyright information

© 1990 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Levcopoulos, C., Petersson, O. (1990). Splitsort—an adaptive sorting algorithm. In: Rovan, B. (eds) Mathematical Foundations of Computer Science 1990. MFCS 1990. Lecture Notes in Computer Science, vol 452. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0029637

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-52953-8

  • Online ISBN: 978-3-540-47185-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics