Radix Sorting with No Extra Space

It iswell known that n integers in the range [1, nc] canbe sorted in O(n) time in the RAM model using radix sorting. More generally, integers in any range [1, U] can be sorted in O(n√log log n) time [5]. However, these algorithms use O(n) words of extra memory. Is this necessary? We present a simple, stable, integer sorting algorithm for words of size O(log n), which works in O(n) time and uses only O(1) words of extra memory on a RAM model. This is the integer sorting case most useful in practice. We extend this result with same bounds to the case when the keys are read-only, which is of theoretical interest. Another interesting question is the case of arbitrary c. Here we present a black-box transformation from any RAM sorting algorithm to a sorting algorithm which uses only O(1) extra space and has the same running time. This settles the complexity of in-place sorting in terms of the complexity of sorting.

[1]  Michael L. Fredman,et al.  Trans-dichotomous algorithms for minimum spanning trees and shortest paths , 1990, Proceedings [1990] 31st Annual Symposium on Foundations of Computer Science.

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

[3]  Yijie Han,et al.  Integer sorting in O(n/spl radic/(log log n)) expected time and linear space , 2002, The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings..

[4]  Rajeev Raman,et al.  Sorting in linear time? , 1995, STOC '95.

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

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

[7]  Michael L. Fredman,et al.  Surpassing the Information Theoretic Bound with Fusion Trees , 1993, J. Comput. Syst. Sci..

[8]  Jyrki Katajainen,et al.  Sorting multisets stably in minimum space , 1992, Acta Informatica.