# Equivalence between priority queues and sorting

```@article{Thorup2007EquivalenceBP,
title={Equivalence between priority queues and sorting},
author={Mikkel Thorup},
journal={J. ACM},
year={2007},
volume={54},
pages={28}
}```
• M. Thorup
• Published 1 December 2007
• Mathematics, Computer Science
• J. ACM
We present a general deterministic linear space reduction from priority queues to sorting implying that if we can sort up to <i>n</i> keys in <i>S</i>(<i>n</i>) time per key, then there is a priority queue supporting delete and insert in <i>O</i>(<i>S</i>(<i>n</i>)) 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… Expand
41 Citations

#### Figures and Topics from this paper

Melding priority queues
• Computer Science, Mathematics
• TALG
• 2006
Improved algorithms for the minimum directed spanning tree problem on graphs with integer edge weights are obtained, namely, a deterministic O(n) time algorithm and a randomized O(i)>(&sqrt;log log <i>n</i>) expected amortized time per operation, respectively. Expand
Black box for constant-time insertion in priority queues (note)
• Mathematics, Computer Science
• TALG
• 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>. Expand
2 Priority Queue
In the last lecture, we discussed algorithms for integer sorting. In this lecture we will discuss the relationship between integer sorting algorithms and priority queue data structures. It is obviousExpand
Sorting algorithms as special cases of a priority queue sort
• Computer Science
• SIGCSE '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. Expand
A survey of the connection between SSSP, sorting, and priority queues on the word RAM
• 2017
We survey and discuss the connection between three of the most fundamental problems in theoretical computer science: sorting, priority queues, and shortest paths. We will begin by illustrating theExpand
Recursive design of hardware priority queues
• Computer Science
• SPAA
• 2013
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. Expand
Optimizing Binary Heaps
• Mathematics, Computer Science
• Theory of Computing Systems
• 2017
A variant of a binary heap that operates in-place, executes minimum and insert in O(1) worst-case time, and extract-min in O (lg n) best- case time is proposed, thereby resolving a long-standing theoretical debate. Expand
DecreaseKeys are expensive for external memory priority queues
• Computer Science, Mathematics
• STOC
• 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. Expand
Dynamic coresets
We give a dynamic data structure that can maintain an μ-coreset of <i>n</i> points, with respect to the extent measure, in <i>O</i>(log <i>n</i>) time for any constant μ > <i>0</i> and any constantExpand
The lock-free k-LSM relaxed priority queue
• Computer Science
• PPoPP 2015
• 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 thatExpand

#### References

SHOWING 1-10 OF 37 REFERENCES
Melding priority queues
• Computer Science, Mathematics
• TALG
• 2006
Improved algorithms for the minimum directed spanning tree problem on graphs with integer edge weights are obtained, namely, a deterministic O(n) time algorithm and a randomized O(i)>(&sqrt;log log <i>n</i>) expected amortized time per operation, respectively. Expand
Black box for constant-time insertion in priority queues (note)
• Mathematics, Computer Science
• TALG
• 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>. Expand
Integer priority queues with decrease key in constant time and the single source shortest paths problem
We consider Fibonacci heap style integer priority queues supporting find-rain, insert, and decrease key operations in constant time. We present a deterministic linear space solution that with nExpand
On RAM priority queues
• M. Thorup
• Computer Science, Mathematics
• SODA '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. Expand
Integer priority queues with decrease key in constant time and the single source shortest paths problem
• M. Thorup
• Computer Science, Mathematics
• STOC '03
• 2003
A deterministic linear space solution that with n integer keys support delete in O(log log n) time, which is a deterministic, worst-case, with no restriction to monotonicity, and exponentially faster. Expand
Improved fast integer sorting in linear space
• Yijie Han
• Computer Science, Mathematics
• SODA '01
• 2001
Improved fast deterministic algorithm for integer sorting in linear space improves the time bound given in [6], and the time complexity for sorting can be further reduced to <i>&Ogr;</i>(<i>n</i> log log <i*n>). Expand
Faster deterministic sorting and priority queues in linear space
• M. Thorup
• Mathematics, Computer Science
• SODA '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. Expand
Deterministic sorting in O(nloglogn) time and linear space
• Yijie Han
• Mathematics, Computer Science
• J. Algorithms
• 2004
A fast deterministic algorithm for integer sorting in linear space in O(n log log n) time and linear space which improves previous best deterministic sorting algorithm and improves the result of Andersson et al. Expand
On AC0 implementations of fusion trees and atomic heaps
• M. Thorup
• Mathematics, Computer Science
• SODA '03
• 2003
The answer is "no" unless you have room for a multiplication table, and both fusion trees and Fredman and Willard's later atomic heaps can be implemented using AC<sup>0</sup> operations on emerging multimedia processors such as the Pentium 4. Expand
Integer Sorting in Expected Time and Linear Space
• Mathematics
• 2002
We present a randomized algorithm sorting integers in expected time and linear space. This improves the previous bound by Anderson et al. from STOC’95. As an immediate consequence, if the integersExpand