Two new algorithms for constructing min-max heaps

  • Lars Draws
  • Patrik Eriksson
  • Erik Forslund
  • Leif Höglund
  • Sören Vallner
  • Thomas Strothotte
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 318)


In this paper we study the computational complexity of constructing implicit, doubleended priority queues organized as min-max heaps, presenting two new algorithms for solving the problem. To construct a min-max heap on n elements, the first one uses 187/96n=1.95 ... n comparisons in the worst case (neglecting lower order terms) and O(n) extra space, while the second one offers a slight improvement in time and space, using (187/96−α)n comparisons, for α ≈ 0.014, i.e., 1.93 ... n comparisons and only O(1) extra space.

The algorithms are particularly interesting as they each have a distinct flavour, even though their time-complexities are virtually identical. The algorithms improve the previously best known upper bound of 2.15 ... n comparisons.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    M.D. Atkinson, J.-R. Sack, N. Santoro, and Th. Strothotte. Min-max heaps and generalized priority queues. Communications of the ACM, 29(10):996–1000, October 1986.Google Scholar
  2. [2]
    S. Carlsson. Average-case analysis of operations on heaps. BIT, 27(1):2–17, 1987.Google Scholar
  3. [3]
    S. Carlsson. The deap — a double-ended heap to implement double-ended priority queues. Information Processing Letters, 26(1):33–36, September 1987.Google Scholar
  4. [4]
    S. Carlsson. Heaps. PhD thesis, Department of Computer Science, Lund University, November 1986.Google Scholar
  5. [5]
    S. Carlsson, J. Chen, and Th. Strothotte. A Note on the Construction of the Data Structure “Deap”. Technical Report, Department of Computer Science, Lund University, February 1988.Google Scholar
  6. [6]
    E. Doberkat. On deleting the root of a heap. Acta Informatica, 17:245–265, 1982.Google Scholar
  7. [7]
    R. W. Floyd. Algorithm 245 — treesort3. Communications of the ACM, 7(12):701, 1964.Google Scholar
  8. [8]
    A. M. Frieze. On the random construction of heaps. Information Processing Letters, 27(2):103–109, February 1988.Google Scholar
  9. [9]
    G. H. Gonnet. Handbook of Algorithms and Data Structures. Addison-Wesley, Reading, MA., 1984.Google Scholar
  10. [10]
    G. H. Gonnet and J. I. Munro. Heaps on heaps. SIAM Journal on Computing, 15(4):964–971, November 1986.Google Scholar
  11. [11]
    A. Hasham and J.-R. Sack. Bounds for min-max heaps. BIT, 27(12):315–323, 1987.Google Scholar
  12. [12]
    C. J. H. McDiarmid and B. A. Reed. Building Heaps Fast. Technical Report, Oxford University, 1987.Google Scholar
  13. [13]
    J.-R. Sack and Th. Strothotte. An algorithm for merging heaps. Acta Informatica, 22:171–185, 1985.Google Scholar
  14. [14]
    Th. Strothotte and J.-R. Sack. Heaps in heaps. Congressus Numerantium, 49:223–235, 1985.Google Scholar
  15. [15]
    J. W. J. Williams. Algorithm 232. Communications of the ACM, 7(6):347–348, 1964.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1988

Authors and Affiliations

  • Lars Draws
    • 1
  • Patrik Eriksson
    • 1
  • Erik Forslund
    • 1
  • Leif Höglund
    • 1
  • Sören Vallner
    • 1
  • Thomas Strothotte
    • 2
  1. 1.Institutionen för Teknisk DatabehandlingUppsala UniversitetUppsalaSweden
  2. 2.Institut für InformatikUniversität StuttgartStuttgart 1F. R. Germany

Personalised recommendations