# Equivalence between priority queues and sorting

@article{Thorup2002EquivalenceBP, title={Equivalence between priority queues and sorting}, author={Mikkel Thorup}, journal={The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings.}, year={2002}, pages={125-134} }

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 S(n)+O(1) 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. Hence, asymptotically this settles the complexity of priority…

## 43 Citations

### Equivalence between Priority Queues and Sorting in External Memory

- Computer Science, MathematicsESA
- 2014

This paper proves that priority queues are computationally equivalent to sorting in external memory, under some mild assumptions, and provides a possibility for proving lower bounds for external sorting via showing a lower bound for priority queues.

### 2 Priority Queue

- Computer Science
- 2005

This lecture will discuss the relationship between integer sorting algorithms and priority queue data structures, and how to make fast priority queues once the authors have fast sorting algorithms.

### Sorting algorithms as special cases of a priority queue sort

- Computer ScienceSIGCSE '11
- 2011

An exercise for revisiting the main sorting algorithms after they have been taught to students in a way that emphasizes the relationships between them, and shows how considering abstraction and extreme cases can lead to the generation of new algorithms.

### Recursive design of hardware priority queues

- Computer Science, MathematicsComput. Networks
- 2014

A recursive and fast construction of an n elements priority queue from exponentially smaller hardware priority queues and size n RAM is presented and an O(n) time sorting algorithm in a system equipped with a O(w√n) entries TCAM is presented.

### Integer Sorting in Expected Time and Linear Space

- Mathematics, Computer Science
- 2002

A randomized algorithm sorting integers in expected time and linear space improves the previous bound by Anderson et al. from STOC’95 and implies improved bounds for deterministic string sorting and integer sorting without multiplication.

### The lock-free k-LSM relaxed priority queue

- Computer SciencePPoPP
- 2015

We present a new, concurrent, lock-free priority queue that relaxes the delete-min operation to allow deletion of any of the ρ smallest keys instead of only a minimal one, where ρ is a parameter that…

### Optimizing Binary Heaps

- Computer ScienceTheory of Computing Systems
- 2017

This work proposes a variant of a binary heap that operates in-place, executes minimum and insert in O(1) worst-case time, and extract-min in Lg n worst- case time while involving at most lg n + O( 1) element comparisons, thereby resolving a long-standing theoretical debate.

### DecreaseKeys are expensive for external memory priority queues

- Computer ScienceSTOC
- 2017

A lower bound of Ω((N/B) lglgN B) I/Os for processing a sequence of N intermixed Insert, ExtraxtMin and DecreaseKey operations is proved and thus holds also for non-comparison-based priority queues.

### Black box for constant-time insertion in priority queues (note)

- Computer ScienceTALG
- 2005

A simple black box is presented that takes a priority queue Q which supports find-min, insert, and delete in x-time at most T at most <i>t</i>.

### Meldable RAM priority queues and minimum directed spanning trees

- Computer ScienceSODA '04
- 2004

Improved algorithms for finding minimum directed spanning trees in graphs with integer edge weights are obtained by combining a randomized "atomic-heap" of Thorup with the classical Fibonacci heaps of Fredman and Tarjan.

## References

SHOWING 1-10 OF 35 REFERENCES

### Faster deterministic sorting and priority queues in linear space

- Computer Science, MathematicsSODA '98
- 1998

The techniques give a deterministic linear space priority queue supporting insert and delete in O((log logn) 2 ) amortized time and nd-min in constant time and can be implemented using addition, shift, and bit-wise boolean operations.

### On RAM priority queues

- Computer ScienceSODA '96
- 1996

On a RAM, the amortized operation cost of a monotone priority queue is equivalent to the per-key cost of sorting, and the equivalence implies that the single source shortest paths problem on a graph with m edges is no harder than that of sorting m keys.

### Integer Sorting in Expected Time and Linear Space

- Mathematics, Computer Science
- 2002

A randomized algorithm sorting integers in expected time and linear space improves the previous bound by Anderson et al. from STOC’95 and implies improved bounds for deterministic string sorting and integer sorting without multiplication.

### Sorting in linear time?

- Computer ScienceSTOC '95
- 1995

We show that a unit-cost RAM with a word length of bits can sort integers in the range in time, for arbitrary ! , a significant improvement over the bound of " # $ achieved by the fusion trees of…

### Trans-dichotomous algorithms for minimum spanning trees and shortest paths

- Computer ScienceProceedings [1990] 31st Annual Symposium on Foundations of Computer Science
- 1990

The fusion tree method is extended to develop a linear-time algorithm for the minimum spanning tree problem and an O(m+n log n/log log n) implementation of Dijkstra's shortest-path algorithm for a…

### Integer sorting in O(n/spl radic/(log log n)) expected time and linear space

- Computer Science, MathematicsThe 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings.
- 2002

A randomized algorithm sorting n integers in O(n/spl radic/(log log n)) expected time and linear space, which implies improved bounds for deterministic string sorting and integer sorting without multiplication.

### Optimal bounds for the predecessor problem

- Computer Science, MathematicsSTOC '99
- 1999

The upper and lower bounds for the amount of time to find the predecessor of a given element among the elements of a fixed efficiently stored set are obtained and apply to the cell probe and RAM models and to both static and dynamic predecessor problems.

### Optimal Bounds for the Predecessor Problem and Related Problems

- Mathematics, Computer ScienceJ. Comput. Syst. Sci.
- 2002

The lower bounds are proved for a large class of problems, including both static and dynamic predecessor problems, in a much stronger communication game model, but they apply to the cell probe and RAM models.

### The cell probe complexity of dynamic data structures

- Computer ScienceSTOC '89
- 1989

New lower and upper bounds on the time per operation are proved to implement solutions to some familiar dynamic data structure problems including list representation, subset ranking, partial sums, and the set union problem.

### Deterministic sorting in O(nlog log n) time and linear space

- Computer ScienceSTOC '02
- 2002

A fast deterministic algorithm for integer sorting in linear space which sorts integers in the range of 0, 1, 2, &1dots;, <i>m</i>—1 inlinear space in time and linear space and uses randomization.