Two new algorithms for constructing min-max heaps
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.
- 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
- S. Carlsson. Average-case analysis of operations on heaps. BIT, 27(1):2–17, 1987.Google Scholar
- 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
- S. Carlsson. Heaps. PhD thesis, Department of Computer Science, Lund University, November 1986.Google Scholar
- 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
- E. Doberkat. On deleting the root of a heap. Acta Informatica, 17:245–265, 1982.Google Scholar
- R. W. Floyd. Algorithm 245 — treesort3. Communications of the ACM, 7(12):701, 1964.Google Scholar
- A. M. Frieze. On the random construction of heaps. Information Processing Letters, 27(2):103–109, February 1988.Google Scholar
- G. H. Gonnet. Handbook of Algorithms and Data Structures. Addison-Wesley, Reading, MA., 1984.Google Scholar
- G. H. Gonnet and J. I. Munro. Heaps on heaps. SIAM Journal on Computing, 15(4):964–971, November 1986.Google Scholar
- A. Hasham and J.-R. Sack. Bounds for min-max heaps. BIT, 27(12):315–323, 1987.Google Scholar
- C. J. H. McDiarmid and B. A. Reed. Building Heaps Fast. Technical Report, Oxford University, 1987.Google Scholar
- J.-R. Sack and Th. Strothotte. An algorithm for merging heaps. Acta Informatica, 22:171–185, 1985.Google Scholar
- Th. Strothotte and J.-R. Sack. Heaps in heaps. Congressus Numerantium, 49:223–235, 1985.Google Scholar
- J. W. J. Williams. Algorithm 232. Communications of the ACM, 7(6):347–348, 1964.Google Scholar