Abstract
As part of a study of the general issue of complexity of comparison based problems, as well as interest in the specific problem, we consider the task of performing the basic priority queue operations on a heap. We show that in the worst case:
-
(i)
log log n comparisons are necessary and sufficient to insert an element into a heap. (This improves the previous upper and lower bounds of log n and 0(1).)
-
(ii)
log n+g(n)−ε(n) comparisons are necessary and sufficient to replace the maximum in a heap. (ε(n) denotes a function in the range [0,1]. This improves the previous upper and lower bounds of 2 log n and log n.)
-
(iii)
1.625n+0(log n * g(n)) comparisons are sufficient to create a heap. 1.37 ... n comparisons are necessary not only in the worst case but also on the average.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
R.W. Floyd, Algorithm 245, Treesort 3, CACM 7, 12 (Dec. 1964), 701.
D.E. Knuth, The Art of Computer Programming, Vol. 3: Sorting and Searching, Addison-Wesley, 1973.
J. Vuillemin, A Data Structure for Manipulating Priority Queues, CACM 21, 4 (April 1978), 309–314.
J.W.J. Williams, Algorithm 232, Heapsort, CACM 7, 6 (June 1964), 347–348.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1982 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Gonnet, G.H., Munro, J.I. (1982). Heaps on heaps. In: Nielsen, M., Schmidt, E.M. (eds) Automata, Languages and Programming. ICALP 1982. Lecture Notes in Computer Science, vol 140. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0012776
Download citation
DOI: https://doi.org/10.1007/BFb0012776
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-11576-2
Online ISBN: 978-3-540-39308-5
eBook Packages: Springer Book Archive