Abstract

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 (√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 ε > 0, we get O ((log log n ) 1+ε ) 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+ε ) 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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call