Equivalence between priority queues and sorting

被引:15
作者
Thorup, Mikkel [1 ]
机构
[1] AT&T Labs Res, Florham Pk, NJ 07932 USA
关键词
algorithms; theory; priority queues; sorting;
D O I
10.1145/1314690.1314692
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
We present a general deterministic linear space reduction from priority queues to sorting implying that if we can sort up to n keys in S( n) time per key, then there is a priority queue supporting delete and insert in O( S( n)) time and find-min in constant time. Conversely, a priority queue can trivially be used for sorting: first insert all keys to be sorted, then extract them in sorted order by repeatedly deleting the minimum. Asymptotically, this settles the complexity of priority queues in terms of that of sorting. Previously, at SODA' 96, such a result was presented by the author for the special case of monotone priority queues where the minimum is not allowed to decrease. Besides nailing down the complexity of priority queues to that of sorting, and vice versa, our result yields several improved bounds for linear space integer priority queues with find-min in constant time: Deterministically. We get O( log log n) update time using a sorting algorithm of Han from STOC' 02. This improves the O(( log log n)( log log log n)) update time of Han from SODA'01. Randomized. We get O(root log log n) expected update time using a randomized sorting algorithm of Han and Thorup from FOCS'02. This improves the O( log log n) expected update time of Thorup from SODA'96. Deterministically in AC(0) ( without multiplication). For any epsilon > 0, we get O((log log n)(1+ epsilon)) update time using an AC(0) sorting algorithm of Han and Thorup from FOCS' 02. This improves the O(( log log n)(2)) update time of Thorup from SODA'98. Randomized in AC(0). We get O( log log n) expected update time using a randomized AC(0) sorting algorithm of Thorup from SODA'97. This improves the O(( log log n)(1+ epsilon)) expected update time of Thorup also from SODA'97. The above bounds assume that each integer is stored in a single word and that word operations take unit time as in the word RAM.
引用
收藏
页数:27
相关论文
共 29 条
  • [1] Black Box for Constant-Time Insertion in Priority Queues (Note)
    Alstrup, Stephen
    Husfeldt, Thore
    Rauhe, Theis
    Thorup, Mikkel
    [J]. ACM TRANSACTIONS ON ALGORITHMS, 2005, 1 (01) : 102 - 106
  • [2] Fusion trees can be implemented with AC0 instructions only
    Andersson, A
    Miltersen, PB
    Thorup, M
    [J]. THEORETICAL COMPUTER SCIENCE, 1999, 215 (1-2) : 337 - 344
  • [3] Dynamic ordered sets with exponential search trees
    Andersson, Arne
    Thorup, Mikkel
    [J]. JOURNAL OF THE ACM, 2007, 54 (03)
  • [4] Optimal bounds for the predecessor problem and related problems
    Beame, P
    Fich, FE
    [J]. JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 2002, 65 (01) : 38 - 72
  • [5] COMRIE LJ, 1929, T OFFICE MACHINARY U, P25
  • [6] Cormen T. H., 2001, Introduction to Algorithms, V2nd
  • [7] Dijkstra E.W., 1959, Numerische mathematik, V1, P269, DOI [10.1007/BF01386390, DOI 10.1007/BF01386390]
  • [8] Dumey A. I., 1956, COMPUT AUTOM, V5, P6
  • [9] Ford LR., 1959, Am Math Month, V66, P387, DOI [DOI 10.2307/2308750, 10.1080/00029890.1959.11989306, DOI 10.1080/00029890.1959.11989306]
  • [10] Fredman M. L., 1989, Proceedings of the Twenty First Annual ACM Symposium on Theory of Computing, P345, DOI 10.1145/73007.73040