Abstract
Many computer algorithms have embedded in them a subalgorithm called a priority queue which produces on demand an element of extreme priority among elements in the queue. Queues on unrestricted priority domains have a running time of Θ(nlogn) for sequences ofn queue operations. We describe a simple priority queue over the priority domain {1,⋯,N} in which initialization, insertion, and deletion takeO(loglogD) time, whereD is the difference between the next lowest and next highest priority elements in the queue. In the case of initialization,D=Θ(N). Finding a least element, greatest element, and the neighbor in priority order of some specified element take constant time. We also consider dynamic space allocation for the data structures used. Space can be allocated in blocks of size Θ(N 1/p), for small integerp.
Similar content being viewed by others
References
A. V. Aho, J. E. Hopcroft, and J. D. Ullman.The Design and Analysis of Computer Algorithms. Addison-Wesley (1974)
M. R. Brown. Implementation and analysis of binomial queue algorithms,SIAM J. Comput. 7, 298–319 (1978)
C. A. Crane. Linear lists and priority queues as balanced binary trees, (Ph.D. Thesis)STAN-CS-72-259, Computer Science Department. Stanford University (February 1972)
D. B. Johnson. Efficient special purpose priority queues,Proc. 15th Annual Allerton Conference on Communication, Control, andComputing. Department of Electrical Engineering and the Coordinated Science Laboratory, University of Illinois, 1–7 (1977)
D. B. Johnson. Efficient algorithms for shortest paths in sparse networks,J. ACM 24, 1–13 (1977)
D. B. Johnson. Priority queues with update and finding minimum spanning trees,Information Processing Letters 4, 53–57 (1975)
A. Jonassen and O.-J. Dahl. Analysis of an algorithm for priority queue administration,BIT 15, 409–422 (1975)
D. E. Knuth.The Art of Computer Programming, Volume 3/Sorting and Searching. Addison-Wesley (1973)
D. E. Knuth.Notes on the van Emde Boas construction of priority deques: An instructive use of recursion (unpublished notes March 1977)
P. Van Emde Boas. Preserving order in a forest in less than logarithmic time,Proc. Sixteenth IEEE Conference on Foundations of Computer Science. Berkeley, California, 75–84 (1975)
P. Van Emde Boas, R. Kaas, and E. Zijlstra. Design and implementation of an efficient priority queue,Mathematical Systems Theory 10, 99–127 (1977)
P. Van Emde Boas. Preserving order in a forest in less than logarithmic time and linear space,Information Processing Letters 6, 80–82 (1977)
Author information
Authors and Affiliations
Additional information
This research was supported by the National Science Foundation under grants MCS 77-21092 and MCS 80-002684.
Rights and permissions
About this article
Cite this article
Johnson, D.B. A priority queue in which initialization and queue operations takeO(loglogD) time. Math. Systems Theory 15, 295–309 (1981). https://doi.org/10.1007/BF01786986
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF01786986