Advertisement

Heaps on heaps

  • Gaston H. Gonnet
  • J. Ian Munro
Conference paper
Part of the Lecture Notes in Computer Science book series (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.

     

Keywords

Maximum Element Binary Search Priority Queue Bottom Level Chain Element 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [Floyd]
    R.W. Floyd, Algorithm 245, Treesort 3, CACM 7, 12 (Dec. 1964), 701.Google Scholar
  2. [Knuth]
    D.E. Knuth, The Art of Computer Programming, Vol. 3: Sorting and Searching, Addison-Wesley, 1973.Google Scholar
  3. [Vuillemin]
    J. Vuillemin, A Data Structure for Manipulating Priority Queues, CACM 21, 4 (April 1978), 309–314.MathSciNetCrossRefGoogle Scholar
  4. [Williams]
    J.W.J. Williams, Algorithm 232, Heapsort, CACM 7, 6 (June 1964), 347–348.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1982

Authors and Affiliations

  • Gaston H. Gonnet
    • 1
  • J. Ian Munro
    • 1
  1. 1.Department of Computer ScienceUniversity of WaterlooWaterlooCanada

Personalised recommendations