Skip to main content

Equivalence Between Priority Queues and Sorting

  • Reference work entry
  • First Online:
Encyclopedia of Algorithms
  • 293 Accesses

Synonyms

Heap

Years and Authors of Summarized Original Work

  • 2007 (2002); Thorup

Problem Definition

A priority queue is an abstract data structure that maintains a set Q of elements, each with an associated value called a key, under the following set of operations [5, 6]:

insert( Q, x, k ): Inserts element x with key k into Q.

find-min( Q ): Returns an element of Q with the minimum key but does not change Q.

delete( Q, x, k ): Deletes element x with key k from Q.

Additionally, the following operations are often supported:

delete-min( Q ): Deletes an element with the minimum key value from Q and returns it.

decrease-key( Q, x, k ): Decreases the current key \(k^{{\prime}}\) of x to k assuming \(k < k^{{\prime}}\).

meld( Q1 ,Q2 ): Given priority queues Q1 and Q2, returns the priority queue \(Q_{1} \cup Q_{2}\).

Observe that a delete-min can be implemented as a find-min followed by a delete, a decrease-key as a delete followed by an insert, and a meld as a series of find-min, delete and insert...

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Recommended Reading

  1. Alstrup S, Husfeldt T, Rauhe T, Thorup M (2005) Black box for constant-time insertion in priority queues (note). ACM TALG 1(1):102–106

    Article  MathSciNet  MATH  Google Scholar 

  2. Andersson A (1996) Faster deterministic sorting and searching in linear space. In: Proceedings of the 37th FOCS, Burlington, pp 135–141

    Google Scholar 

  3. Arge L, Thorup M (2013) RAM-efficient external memory sorting. In: Proceedings of the 24th ISAAC, Hong Kong, pp 491–501

    Google Scholar 

  4. Cohen E, Duffield N, Kaplan H, Lund C, Thorup M (2009) Stream sampling for variance-optimal estimation of subset sums. In: Proceedings of the 20th SODA, New York, pp 1255–1264

    Google Scholar 

  5. Cormen T, Leiserson C, Rivest R, Stein C (2009) Introduction to algorithms. MIT, Cambridge

    MATH  Google Scholar 

  6. Fredman M, Tarjan R (1987) Fibonacci heaps and their uses in improved network optimization algorithms. J ACM 34(3):596–615

    Article  MathSciNet  Google Scholar 

  7. Fredman M, Willard D (1994) Trans-dichotomous algorithms for minimum spanning trees and shortest paths. J Comput Syst Sci 48:533–551

    Article  MathSciNet  MATH  Google Scholar 

  8. Han Y (2001) Improved fast integer sorting in linear space. Inf Comput 170(8):81–94. Announced at STACS’00 and SODA’01

    Google Scholar 

  9. Han Y (2004) Deterministic sorting in \(O(n\log \log n)\) time and linear space. J Algorithms 50(1):96–105. Announced at STOC’02

    Google Scholar 

  10. Han Y, Thorup M (2002) Integer sorting in \(O(n\sqrt{\log \log n})\) expected time and linear space. In: Proceedings of the 43rd FOCS, Vancouver, pp 135–144

    Google Scholar 

  11. Mendelson R, Tarjan R, Thorup M, Zwick U (2006) Melding priority queues. ACM TALG 2(4):535–556. Announced at SODA’04

    Google Scholar 

  12. Pagh A, Pagh R, Thorup M (2004) On adaptive integer sorting. In: Proceedings of the 12th ESA, Bergen, pp 556–579

    Google Scholar 

  13. Thorup M (1998) Faster deterministic sorting and priority queues in linear space. In: Proceedings of the 9th SODA, San Francisco, pp 550–555

    Google Scholar 

  14. Thorup M (2000) On RAM priority queues. SIAM J Comput 30(1):86–109. Announced at SODA’96

    Google Scholar 

  15. Thorup M (2002) Randomized sorting in \(O(n\log \log n)\) time and linear space using addition, shift, and bit-wise boolean operations. J Algorithms 42(2):205–230. Announced at SODA’97

    Google Scholar 

  16. Thorup M (2004) Integer priority queues with decrease key in constant time and the single source shortest paths problem. J Comput Syst Sci (special issue on STOC’03) 69(3):330–353

    Article  MathSciNet  MATH  Google Scholar 

  17. Thorup M (2007) Equivalence between priority queues and sorting. J ACM 54(6):28. Announced at FOCS’02

    Google Scholar 

  18. Vollmer H (1999) Introduction to circuit complexity: a uniform approach. Springer, Berlin/ New York

    Book  MATH  Google Scholar 

  19. Wei Z, Yi K (2014) Equivalence between priority queues and sorting in external memory. In: Proceedings of 22nd ESA, Wroclaw, pp 830–841

    Google Scholar 

  20. Willard D (2000) Examining computational geometry, van Emde Boas trees, and hashing from the perspective of the fusion tree. SIAM J Comput 29(3):1030–1049. Announced at SODA’92

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to RezaulA. Chowdhury .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer Science+Business Media New York

About this entry

Cite this entry

Chowdhury, R. (2016). Equivalence Between Priority Queues and Sorting. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_127

Download citation

Publish with us

Policies and ethics