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

  • J. Ian Munro
  • Venkatesh Raman
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 560)


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(n2) comparisons in the worst case. Here, we develop a new algorithm for the problem that performs only O(n1+ε) 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.


Data Movement Binary Search Extra Space Final Block Stable Version 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    E. H. Friend, Sorting on Electronic Computers, Journal of the ACM, 3(2) (1956) 134–168.CrossRefGoogle Scholar
  2. [2]
    B. C. Huang and M. A. Langston, Practical In-place Merging, Communications of the ACM, 31(3) (1988) 348–352.CrossRefGoogle Scholar
  3. [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. [4]
    D. E. Knuth, The Art of Computer Programming. Volume III: Sorting and Searching, Addison-Wesley (1973).Google Scholar
  5. [5]
    M. A. Kronrod, Optimal Ordering Algorithm without Operational Field, Soviet Math. Dokl. 10 (1969) 744–746.Google Scholar
  6. [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. [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.CrossRefGoogle Scholar
  8. [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. [9]
    J. I. Munro and V. Raman, Selection in Read-Only Memory and Sorting with Optimum Data Movement, submitted for publication.Google Scholar
  10. [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. [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. [12]
    L. Trabb Pardo, Stable Sorting and Merging with Optimal Space and Time Bounds, SIAM J. of Computing 6 (1977) 351–372.CrossRefGoogle Scholar
  13. [13]
    J. W. J. Williams, Algorithm 232, Heapsort, Communications of the ACM, 7 (1964) 347–348.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • J. Ian Munro
    • 1
  • Venkatesh Raman
    • 1
  1. 1.Department of Computer ScienceUniversity of WaterlooWaterlooCanada

Personalised recommendations