arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0706.4107cs.DS
收藏

无额外空间的基数排序

Radix Sorting With No Extra Space

Gianni Franceschini, S. Muthukrishnan, Mihai Patrascu

摘要:

在RAM模型中,使用基数排序可以在O(n)时间内对范围[1,n ^c]中的n个整数进行排序。一般来说,任何范围[1,U]内的整数都可以在O(n sqrt{loglog n})时间内排序。但是,这些算法使用O(n)字的额外内存。有这个必要吗?我们提出了一个简单的,稳定的,整数排序算法的大小为O(log n)的字,它的工作时间为O(n),只使用O(1)字的额外内存的RAM模型。这是整数排序在实践中最有用的情况。我们将这个结果推广到了密钥是只读的情况,这是一个有理论意义的结果。另一个有趣的问题是任意c的情况。在这里,我们提出了一个黑盒转换从任何RAM排序算法的排序算法,只使用O(1)的额外空间,并具有相同的运行时间。这就解决了就地排序的复杂性。

英文摘要:

It is well known that n integers in the range [1,n^c] can be 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 sqrt{loglog n}) time. 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑