(Translated by https://www.hiragana.jp/)
Stable in situ sorting and minimum data movement | BIT Numerical Mathematics Skip to main content
Log in

Stable in situ sorting and minimum data movement

  • Part I Computer Science
  • Published:
BIT Aims and scope Submit manuscript

Abstract

In this paper, we describe an algorithm to stably sort an array ofn elements using only a linear number of data movements and constant extra space, albeit in quadratic time. It was not known previously whether such an algorithm existed. When the input contains only a constant number of distinct values, we present a sequence ofin situ stable sorting algorithms makingO(n lg(k+1) n+kn) comparisons (lg(K) means lg iteratedk times and lg* the number of times the logarithm must be taken to give a result ≤ 0) andO(kn) data movements for any fixed valuek, culminating in one that makesO(n lg*n) comparisons and data movements. Stable versions of quicksort follow from these algorithms.

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

Access this article

Price includes VAT (Japan)

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. S. Baase,Computer Algorithms: Introduction to Design and Analysis, Addison-Wesley (1988).

  2. B. Ďurian,Quicksort without a stack, Math. Foundations of Computer Science,Lecture Notes in Computer Science 223,Springer Verlag (1986) 283–289.

  3. D. Gries,Constant-space quicksort, Unpublished manuscript, March 1989.

  4. T. Hoare,Quicksort, CACM 4 (7) (1961) 321.

    Google Scholar 

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

  6. D. E. Knuth,Mathematical Analysis of Algorithms, Proceedings, I.F.I.P. Congress, ed. C.V. Frieman, North-Holland, Amsterdam (1972) 19–27.

    Google Scholar 

  7. M. A. Kronrod,Optimal ordering algorithm without operational field, Soviet Math. Dokl.10 (1969) 744–746.

    MATH  Google Scholar 

  8. I. D. G. Macleod,An algorithm for in-situ permutation, Australian Computing Journal2 (1970) 16–19.

    Google Scholar 

  9. 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 382,Springer Verlag (August 1989) 552–562.

  10. L. Trabb Pardo,Stable sorting and merging with optimal space and time bounds, SIAM J. on Computing6 (1977) 351–372.

    Article  MATH  MathSciNet  Google Scholar 

  11. J. S. Salowe and W. L. Steiger,Stable unmerging in linear time and constant space, IPL25 (1987) 285–294.

    Article  MATH  MathSciNet  Google Scholar 

  12. J. S. Salowe and W. L. Steiger,Simplified stable merging tasks, J. Algorithms 8 (1987) 557–571.

    Article  MATH  MathSciNet  Google Scholar 

  13. L. M. Wegner,A generalized one way stackless quicksort, BIT27 (1987) 44–48.

    Article  MATH  MathSciNet  Google Scholar 

  14. P. F. Windley,Transposing matrices in a digital computer, The Computer Journal2 (1959) 47–48.

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

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

Supported in part by a Research Initiation Grant from the Virginia Engineering Foundation.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Munro, J.I., Raman, V. & Salowe, J.S. Stable in situ sorting and minimum data movement. BIT 30, 220–234 (1990). https://doi.org/10.1007/BF02017344

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

CR categories

Navigation