Sorting Multisets Stably in Minimum Space

In a decision tree model, Ω(n log2n − ∑ m i=1 ni log2ni + 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 A0 and A1. The problem is to recover A from its constituents A0 and A1. The information available is the partitioning element used and a bit array of size n indicating whether an element of A0 or A1 was originally in the corresponding position of A.

[1]  Jeffrey S. Salowe,et al.  Stable Unmerging in Linear Time and Constant Space , 1987, Inf. Process. Lett..

[2]  Christos Levcopoulos,et al.  Space-Efficient Parallel Merging , 1992, RAIRO Theor. Informatics Appl..

[3]  Christos Levcopoulos,et al.  An Optimal Adaptive In-place Sorting Algorithm , 1991, FCT.

[4]  Ellis Horowitz,et al.  Fundamentals of Computer Algorithms , 1978 .

[5]  Michael A. Langston,et al.  Practical in-place merging , 1987, CACM.

[6]  Venkatesh Raman,et al.  Sorting Multisets and Vectors In-Place , 1991, WADS.

[7]  J. Ian Munro,et al.  Sorting and Searching in Multisets , 1976, SIAM J. Comput..

[8]  Teofilo F. Gonzalez,et al.  Sorting Numbers in Linear Expected Time and Optimal Extra Space , 1982, Inf. Process. Lett..

[9]  Jyrki Katajainen,et al.  Stable minimum space partitioning in linear time , 1992, BIT.

[10]  J. IAN MUNRO,et al.  An Implicit Data Structure Supporting Insertion, Deletion, and Search in O(log² n) Time , 1986, J. Comput. Syst. Sci..

[11]  Lutz M. Wegner Quicksort for Equal Keys , 1985, IEEE Transactions on Computers.

[12]  Jeffrey S. Salowe,et al.  Simplified Stable Merging Tasks , 1987, J. Algorithms.

[13]  Manuel Blum,et al.  Time Bounds for Selection , 1973, J. Comput. Syst. Sci..

[14]  J. Ian Munro,et al.  An Implicit Binomial Queue with Constant Insertion Time , 1988, SWAT.

[15]  Lutz M. Wegner A generalized, one-way, stackless quicksort , 1987, BIT Comput. Sci. Sect..

[16]  Michael A. Langston,et al.  Fast Stable Merging and Sorting in Constant Extra Space , 1992, Comput. J..

[17]  Alistair Moffat,et al.  An Overview of Adaptive Sorting , 1992, Aust. Comput. J..

[18]  Edward C. Horvath,et al.  Stable Sorting in Asymptotically Optimal Time and Extra Space , 1978, JACM.

[19]  Branislav Durian Quicksort Without a Stack , 1986, MFCS.

[20]  Venkatesh Raman,et al.  Stable in situ sorting and minimum data movement , 1990, BIT.