Skip to main content

Sorting multisets stably in minimum space

  • Conference paper
  • First Online:
Book cover Algorithm Theory — SWAT '92 (SWAT 1992)

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

Included in the following conference series:

Abstract

In a decision tree model, Ω(n log2 n − ∑ i=1m n i log2 n i + n) is known to be a lower bound for sorting a multiset of size n containing m distinct elements, where the ith distinct element appears n t times. We present a minimum space algorithm that sorts stably a multiset in asymptotically optimal worst-case time. A Quicksort type approach is used, where at each recursive step the median is chosen as the partitioning element. To obtain a stable minimum space implemention, we develop linear-time in-place algorithms for the following problems, which have interest of their own: Stable unpartitioning: Assume that an n-element array A is stably partitioned into two subarrays A 0 and A 1. The problem is to recover A from its constituents A 0 and A 1. The information available is the partitioning element used and a bit array of size n indicating whether an element of A 0 or A 1 was originally in the corresponding position of A.

Stable selection: The task is to find the kth smallest element in a multiset of n elements such that the relative order of identical elements is retained.

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. M. Blum, R.W. Floyd, V. Pratt, R.L. Rivest, R.E. Tarjan: Time bounds for selection. Journal of Computer and System Sciences 7 (1973) 448–461

    Google Scholar 

  2. S. Carlsson, J.I. Munro, P.V. Poblete: An implicit binomial queue with constant insertion time. 1st Scandinavian Workshop on Algorithm Theory. Lecture Notes in Computer Science 318. Springer-Verlag, 1988, pp. 1–13

    Google Scholar 

  3. B. Ďurian: Quicksort without a stack. Mathematical Foundations of Computer Science 1986. Lecture Notes in Computer Science 233. Springer-Verlag, 1986, pp. 283–289

    Google Scholar 

  4. T.F. Gonzalez, D.B. Johnson: Sorting numbers in linear expected time and optimal extra space. Information Processing Letters 15 (1982) 119–124

    Google Scholar 

  5. E. Horowitz, S. Sahni: Fundamentals of Computer Algorithms. Computer Science Press, 1978

    Google Scholar 

  6. E.C. Horvath: Stable sorting in asymptotically optimal time and extra space. Journal of the ACM 25 (1978) 177–199

    Google Scholar 

  7. B.-C. Huang, M.A. Langston: Practical in-place merging. Communications of the ACM 31 (1988) 348–352

    Google Scholar 

  8. B.-C. Huang, M.A. Langston: Fast stable merging and sorting in constant extra space. International Conference on Computing and Information, 1989, pp. 71–80

    Google Scholar 

  9. B.-C. Huang, M.A. Langston: Stable dublicate-key extraction with optimal time and space bounds. Acta Informatica 26 (1989) 473–484

    Google Scholar 

  10. J. Katajainen, C. Levcopoulos, O. Petersson: Space-efficient parallel merging. PARLE'92 — Parallel Architectures and Languages Europe (to appear)

    Google Scholar 

  11. J. Katajainen, T. Pasanen: Stable minimum space partitioning in linear time. BIT (to appear)

    Google Scholar 

  12. M.A. Kronrod: Optimal ordering algorithm without operational field. Soviet Mathematics 10 (1969) 744–746

    Google Scholar 

  13. T.W. Lai, D. Wood: Implicit selection. 1st Scandinavian Workshop on Algorithm Theory. Lecture Notes in Computer Science 318. Springer-Verlag, 1988, pp. 14–23

    Google Scholar 

  14. C. Levcopoulos, O. Petersson: An optimal adaptive in-place sorting algorithm. 8th International Conference on Fundamentals of Computation Theory. Lecture Notes in Computer Science 529. Springer-Verlag, 1991, pp. 329–338

    Google Scholar 

  15. C. Levcopoulos, O. Petersson: Sorting shuffled monotone sequences. Information & Computation (to appear)

    Google Scholar 

  16. A.M. Moffat, O. Petersson: An overview of adaptive sorting. Australian Computer Journal (to appear)

    Google Scholar 

  17. J.I. Munro: An implicit data structure supporting insertion, deletion, and search in O(log2 n) time. Journal of Computer and System Sciences 33 (1986) 66–74

    Google Scholar 

  18. J.I. Munro, V. Raman: Sorting multisets and vectors in-place, 2nd Workshop on Algorithms and Data Structures. Lecture Notes in Computer Science 519. Springer-Verlag, 1991, pp. 473–480

    Google Scholar 

  19. J.I. Munro, V. Raman, J.S. Salowe: Stable in situ sorting and minimum data movement. BIT 30 (1990) 220–234

    Google Scholar 

  20. J.I. Munro, P.M. Spira: Sorting and searching in multisets. SIAM Journal on Computing 5 (1976) 1–8

    Google Scholar 

  21. J.S. Salowe, W.L. Steiger: Simplified stable merging tasks. Journal of Algorithms 8 (1987) 557–571

    Google Scholar 

  22. J.S. Salowe, W.L. Steiger: Stable unmerging in linear time and constant space. Information Processing Letters 25 (1987) 285–294

    Google Scholar 

  23. L.M. Wegner: Quicksort for equal keys. IEEE Transactions on Computers C34 (1985) 362–367

    Google Scholar 

  24. L.M. Wegner: A generalized, one-way, stackless Quicksort. BIT 27 (1987) 44–48

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Otto Nurmi Esko Ukkonen

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Katajainen, J., Pasanen, T. (1992). Sorting multisets stably in minimum space. In: Nurmi, O., Ukkonen, E. (eds) Algorithm Theory — SWAT '92. SWAT 1992. Lecture Notes in Computer Science, vol 621. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55706-7_37

Download citation

  • DOI: https://doi.org/10.1007/3-540-55706-7_37

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55706-7

  • Online ISBN: 978-3-540-47275-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics