Skip to main content

Heaps on heaps

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 140))

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:

  1. (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).)

  2. (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.)

  3. (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.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R.W. Floyd, Algorithm 245, Treesort 3, CACM 7, 12 (Dec. 1964), 701.

    Google Scholar 

  2. D.E. Knuth, The Art of Computer Programming, Vol. 3: Sorting and Searching, Addison-Wesley, 1973.

    Google Scholar 

  3. J. Vuillemin, A Data Structure for Manipulating Priority Queues, CACM 21, 4 (April 1978), 309–314.

    Article  MathSciNet  Google Scholar 

  4. J.W.J. Williams, Algorithm 232, Heapsort, CACM 7, 6 (June 1964), 347–348.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Mogens Nielsen Erik Meineche Schmidt

Rights and permissions

Reprints 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

Publish with us

Policies and ethics