Skip to main content

Fast stable in-place sorting with O(n) data moves

  • Conference paper
  • First Online:
Foundations of Software Technology and Theoretical Computer Science (FSTTCS 1991)

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

Abstract

Until recently, it was not known whether it was possible to stably sort (Le. keeping equal elements in their initial order) an array of n elements using only O(n) data movements and O(1) extra space. In [10], an algorithm was given to perform this task in O(n 2) comparisons in the worst case. Here, we develop a new algorithm for the problem that performs only O(n 1+ε) comparisons (0<ε<1 is any fixed constant) in the worst case. This bound on the number of comparisons matches (asymptotically) the best known bound for the same problem with the stability constraint dropped.

Research supported by Natural Sciences and Engineering Research Council of Canada grant No. A-8237 and the Information Technology Research Centre of Ontario

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. E. H. Friend, Sorting on Electronic Computers, Journal of the ACM, 3(2) (1956) 134–168.

    Article  Google Scholar 

  2. B. C. Huang and M. A. Langston, Practical In-place Merging, Communications of the ACM, 31(3) (1988) 348–352.

    Article  Google Scholar 

  3. B. C. Huang and M. A. Langston, Fast Stable Merging and Sorting in Constant Extra Space, Computing and Information, (1989), 71–79.

    Google Scholar 

  4. D. E. Knuth, The Art of Computer Programming. Volume III: Sorting and Searching, Addison-Wesley (1973).

    Google Scholar 

  5. M. A. Kronrod, Optimal Ordering Algorithm without Operational Field, Soviet Math. Dokl. 10 (1969) 744–746.

    Google Scholar 

  6. T. W. Lai and D. Wood, Implicit Selection, Proceedings of the Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science 318, Springer Verlag, (1988) 14–23.

    Google Scholar 

  7. J. I. Munro, An Implicit Data Structure Supporting Insertion, Deletion, and Search in O(lg 2n) time, Journal of Computer and System Sciences, 21 (1980) 236–250.

    Article  Google Scholar 

  8. J. I. Munro and V. Raman, Sorting with Minimum Data Movement, Proceedings of Workshop on Algorithms and Data Structures, Ottawa, Lecture Notes in Computer Science, Springer Verlag 382 (1989) 552–562; (revised version to appear in Journal of Algorithms)

    Google Scholar 

  9. J. I. Munro and V. Raman, Selection in Read-Only Memory and Sorting with Optimum Data Movement, submitted for publication.

    Google Scholar 

  10. J. I. Munro, V. Raman and J. S. Salowe, Stable In Situ Sorting and Minimum Data Movement, BIT 30 (1990) 220–234.

    Google Scholar 

  11. V. Raman, Sorting In-Place with Minimum Data Movement, Ph.D. Thesis, Technical Report CS 91-12, Department of Computer Science, University of Waterloo (1991).

    Google Scholar 

  12. L. Trabb Pardo, Stable Sorting and Merging with Optimal Space and Time Bounds, SIAM J. of Computing 6 (1977) 351–372.

    Article  Google Scholar 

  13. J. W. J. Williams, Algorithm 232, Heapsort, Communications of the ACM, 7 (1964) 347–348.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Somenath Biswas Kesav V. Nori

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Munro, J.I., Raman, V. (1991). Fast stable in-place sorting with O(n) data moves. In: Biswas, S., Nori, K.V. (eds) Foundations of Software Technology and Theoretical Computer Science. FSTTCS 1991. Lecture Notes in Computer Science, vol 560. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-54967-6_74

Download citation

  • DOI: https://doi.org/10.1007/3-540-54967-6_74

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-54967-3

  • Online ISBN: 978-3-540-46612-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics