Hostname: page-component-77f85d65b8-6c7dr Total loading time: 0 Render date: 2026-03-28T05:19:54.775Z Has data issue: false hasContentIssue false

Optimal purely functional priority queues

Published online by Cambridge University Press:  07 November 2008

Gerth Stølting Brodal*
Affiliation:
BRICS,† Department of Computer Science, University of Aarhus, Ny Munkegade, DK-8000 Århus C, Denmark (e-mail: gerth@daimi.aau.dk)
Chris Okasaki*
Affiliation:
School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213, USA (e-mail: cokasaki@cs.cmu.edu)
*
*Research partially supported by the ESPRIT II Basic Research Actions Program of the EC under contract no. 7141 (project ALCOM II) and by the Danish Natural Science Research Council (Grant No. 9400044).
Research supported by the Advanced Research Projects Agency CSTO under the title “The Fox Project: Advanced Languages for Systems Software”, ARPA Order No. C533, issued by ESC/ENS under Contract No. F19628-95-C-0050.
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Brodal recently introduced the first implementation of imperative priority queues to support findMin, insert and meld in O(1) worst-case time, and deleteMin in O(log n) worst-case time. These bounds are asymptotically optimal among all comparison-based priority queues. In this paper, we adapt Brodal's data structure to a purely functional setting. In doing so, we both simplify the data structure and clarify its relationship to the binomial queues of Vuillemin, which support all four operations in O(log n) time. Specifically, we derive our implementation from binomial queues in three steps: first, we reduce the running time of insert to O(1) by eliminating the possibility of cascading links; second, we reduce the running time of findMin to O(1) by adding a global root to hold the minimum element; and finally, we reduce the running time of meld to O(1) by allowing priority queues to contain other priority queues. Each of these steps is expressed using ML-style functors. The last transformation, known as data-structural bootstrapping, is an interesting application of higher-order functors and recursive structures.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1996
Submit a response

Discussions

No Discussions have been published for this article.