Skip to main content

Sorting multisets and vectors in-place

  • Conference paper
  • First Online:
Algorithms and Data Structures (WADS 1991)

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

Included in the following conference series:

Abstract

When a list to be sorted consists of many repeated elements (i.e. when it is a multiset), the familiar Ω(n lg n) lower bound on the number of comparisons is replaced by a bound that depends on the multiplicities of the elements in the list. We adapt heapsort for multisets and provide the first in-place algorithm for multisets that achieves the optimal bound up to lower order terms. We, then, obtain an optimal in-place algorithm to lexicographically sort an array of multidimensional vectors, by applying the multiset sorting algorithm in each coordinate.

We exploit the relationship between the two sorting problems to improve the lower order term of a known lower bound[2] for sorting multisets. It follows that the (“non in-place”) algorithms developed by Munro and Spira [8] for multisets are within O(n) time optimal. Our improvement to the lower bound for sorting multisets also improves a lower bound (in the lower order term) for determining the mode, the most frequently occurring element in the multiset.

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. J. L. Bently and J. B. Saxe, Algorithms on Vector Sets, SIGACT News, Fall (1979) 36–39.

    Google Scholar 

  2. D. Dobkin and J. I. Munro, Determining the Mode, Theoretical Computer Science 12 (1980) 255–263.

    Google Scholar 

  3. Th. M. Fischer, Refined Bounds on the Complexity of Sorting and Selection in D-Dimensional Space, Proceedings of MFCS, Lecture Notes in Computer Science, Springer Verlag 233 (1986) 309–314.

    Google Scholar 

  4. G. H. Gonnet and J. I. Munro, Heaps on Heaps, SIAM Journal of Computing 15 (4) (1986), 964–971.

    Google Scholar 

  5. D. E. Knuth, The Art of Computer Programming. Volume I: Fundamental Algorithms, Addison-Wesley (1973).

    Google Scholar 

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

    Google Scholar 

  7. U. Manber and G. Myers, Suffix Arrays: A New Method for On-Line String Searches, Proceedings of the first annual ACM-SIAM Symposium on Discrete Algorithms (1990) 319–327.

    Google Scholar 

  8. I. Munro and P. M. Spira, Sorting and Searching in Multisets, SIAM Journal of Computing, 5 (1) (1976) 1–8.

    Google Scholar 

  9. L. M. Wegner, Quicksort for Equal Keys, IEEE Transactions on Computers, C-34 (4) (1985) 362–367.

    Google Scholar 

  10. J. Wiedermann, The Complexity of Lexicographic Sorting and Searching, Proceedings of MFCS, Lecture Notes in Computer Science, Springer Verlag 74 (1979) 517–522.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Frank Dehne Jörg-Rüdiger Sack Nicola Santoro

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). Sorting multisets and vectors in-place. In: Dehne, F., Sack, JR., Santoro, N. (eds) Algorithms and Data Structures. WADS 1991. Lecture Notes in Computer Science, vol 519. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0028285

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-54343-5

  • Online ISBN: 978-3-540-47566-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics