Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Fast stable in-place sorting withO(n) data moves

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

Until recently, it was not known whether it was possible to sortstably (i.e., keeping equal elements in their initial order) an array ofn elements using onlyO(n) data moves andO(1) extra space. In [13] an algorithm was given to perform this task inO(n 2) comparisons in the worst case. Here, we develop a new algorithm for the problem that performs onlyO(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.

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

Access this article

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

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. Langsten, 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,Proceedings of the International Conference on Computing and Information, 1989, pp. 71–80.

  4. J. Katajainen and T. Pasanen, Sorting Multisets Stably in Minimum Space,Proceedings of the 3rd Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science, Vol. 621, Springer-Verlag, Berlin, 1992, pp. 410–421.

    Google Scholar 

  5. D. E. Knuth,The Art of Computer Programming, Vol. III, Addison-Wesley, Reading, MA, 1973.

    Google Scholar 

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

    Google Scholar 

  7. T. W. Lai and D. Wood, Implicit Selection,Proceedings of the 1st Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science, Vol. 318, Springer-Verlag, Berlin, 1988, pp. 14–23.

    Google Scholar 

  8. J. I. Munro, An Implicit Data Structure Supporting Insertion, Deletion, and Search inO(lg2 n) Time,Journal of Computer and System Sciences,21 (1980), 236–250.

    Article  Google Scholar 

  9. J. I. Munro and V. Raman, Fast Stable In-Place Sorting withO(n) Data Moves,Proceedings ofthe 11th FST & TCS Conference, New Delhi, Lecture Notes in Computer Science, Vol. 560, Springer-Verlag, Berlin, 1991, pp. 266–277.

    Google Scholar 

  10. J. I. Munro and V. Raman, Sorting Multisets and Vectors In-Place,Proceedings of the 2nd Workshop on Algorithms and Data Structures, Lecture Notes in Computer Science, Vol. 519, Springer-Verlag, Berlin, 1991, pp. 473–480.

    Google Scholar 

  11. J. I. Munro and V. Raman, Sorting with Minimum Data Movement,Journal of Algorithms,13 (1992), 374–393.

    Article  Google Scholar 

  12. J. I. Munro and V. Raman, Selection from Read-Only Memory and Sorting with Optimum Data Movement,Proceedings of the 12th FST & TCS Conference, New Delhi, Lecture Notes in Computer Science, Vol. 652, Springer-Verlag, Berlin, 1992, pp. 380–391; to appear inTheoretical Computer Science.

    Google Scholar 

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

    Google Scholar 

  14. 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).

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

    Article  Google Scholar 

  16. 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

Additional information

Communicated by R. Sedgewick.

A version of this paper appeared in theProceedings-of the 11th FST & TCS Conference [9]. This research was supported by NSERC of Canada grant No. A-8237 and the ITRC of Ontario.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Munro, J.I., Raman, V. Fast stable in-place sorting withO(n) data moves. Algorithmica 16, 151–160 (1996). https://doi.org/10.1007/BF01940644

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Key words