Pairing heaps: the forward variant

Authors Dani Dorfman, Haim Kaplan, László Kozma, Uri Zwick

Thumbnail PDF


  • Filesize: 0.53 MB
  • 14 pages

Document Identifiers

Author Details

Dani Dorfman
  • Blavatnik School of Computer Science, Tel Aviv University, Israel
Haim Kaplan
  • Blavatnik School of Computer Science, Tel Aviv University, Israel
László Kozma
  • Eindhoven University of Technology, The Netherlands
Uri Zwick
  • Blavatnik School of Computer Science, Tel Aviv University, Israel

Cite AsGet BibTex

Dani Dorfman, Haim Kaplan, László Kozma, and Uri Zwick. Pairing heaps: the forward variant. In 43rd International Symposium on Mathematical Foundations of Computer Science (MFCS 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 117, pp. 13:1-13:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


The pairing heap is a classical heap data structure introduced in 1986 by Fredman, Sedgewick, Sleator, and Tarjan. It is remarkable both for its simplicity and for its excellent performance in practice. The "magic" of pairing heaps lies in the restructuring that happens after the deletion of the smallest item. The resulting collection of trees is consolidated in two rounds: a left-to-right pairing round, followed by a right-to-left accumulation round. Fredman et al. showed, via an elegant correspondence to splay trees, that in a pairing heap of size n all heap operations take O(log n) amortized time. They also proposed an arguably more natural variant, where both pairing and accumulation are performed in a combined left-to-right round (called the forward variant of pairing heaps). The analogy to splaying breaks down in this case, and the analysis of the forward variant was left open. In this paper we show that inserting an item and deleting the minimum in a forward-variant pairing heap both take amortized time O(log(n) * 4^(sqrt(log n))). This is the first improvement over the O(sqrt(n)) bound showed by Fredman et al. three decades ago. Our analysis relies on a new potential function that tracks parent-child rank-differences in the heap.

Subject Classification

ACM Subject Classification
  • Theory of computation → Data structures design and analysis
  • data structure
  • priority queue
  • pairing heap


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. G. M. Adelson-Velskiĭ and E. M. Landis. An algorithm for organization of information. Dokl. Akad. Nauk SSSR, 146:263-266, 1962. Google Scholar
  2. Rudolf Bayer. Symmetric binary b-trees: Data structure and maintenance algorithms. Acta Informatica, 1(4):290-306, Dec 1972. URL:
  3. Parinya Chalermsook, Mayank Goswami, László Kozma, Kurt Mehlhorn, and Thatchaphol Saranurak. Self-adjusting binary search trees: What makes them tick? In ESA 2015, pages 300-312, 2015. URL:
  4. Timothy M. Chan. Quake Heaps: A Simple Alternative to Fibonacci Heaps, pages 27-32. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013. URL:
  5. Thomas H. Cormen, Clifford Stein, Ronald L. Rivest, and Charles E. Leiserson. Introduction to Algorithms. McGraw-Hill Higher Education, 2nd edition, 2001. Google Scholar
  6. Amr Elmasry. Pairing heaps with O(log log n) decrease cost. In Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2009, New York, NY, USA, January 4-6, 2009, pages 471-476, 2009. URL:
  7. Amr Elmasry. The violation heap: a relaxed fibonacci-like heap. Discrete Math., Alg. and Appl., 2(4):493-504, 2010. URL:
  8. Michael L. Fredman. On the efficiency of pairing heaps and related data structures. J. ACM, 46(4):473-501, 1999. URL:
  9. Michael L. Fredman, Robert Sedgewick, Daniel Dominic Sleator, and Robert Endre Tarjan. The pairing heap: A new form of self-adjusting heap. Algorithmica, 1(1):111-129, 1986. URL:
  10. Michael L. Fredman and Robert Endre Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms. In 25th Annual Symposium on Foundations of Computer Science, West Palm Beach, Florida, USA, 24-26 October 1984, pages 338-346, 1984. URL:
  11. Leonidas J. Guibas and Robert Sedgewick. A dichromatic framework for balanced trees. In 19th Annual Symposium on Foundations of Computer Science, Ann Arbor, Michigan, USA, 16-18 October 1978, pages 8-21, 1978. URL:
  12. Bernhard Haeupler, Siddhartha Sen, and Robert Endre Tarjan. Rank-pairing heaps. SIAM J. Comput., 40(6):1463-1485, 2011. URL:
  13. Thomas Dueholm Hansen, Haim Kaplan, Robert Endre Tarjan, and Uri Zwick. Hollow heaps. In Automata, Languages, and Programming - 42nd International Colloquium, ICALP 2015, Kyoto, Japan, July 6-10, 2015, Proceedings, Part I, pages 689-700, 2015. URL:
  14. John Iacono. Improved upper bounds for pairing heaps. In Algorithm Theory - SWAT 2000, 7th Scandinavian Workshop on Algorithm Theory, Bergen, Norway, July 5-7, 2000, Proceedings, pages 32-45, 2000. URL:
  15. John Iacono. In pursuit of the dynamic optimality conjecture. In Space-Efficient Data Structures, Streams, and Algorithms, volume 8066 of Lecture Notes in Computer Science, pages 236-250. Springer Berlin Heidelberg, 2013. URL:
  16. John Iacono and Özgür Özkan. A tight lower bound for decrease-key in the pure heap model. CoRR, abs/1407.6665, 2014. URL:
  17. John Iacono and Özgür Özkan. Why some heaps support constant-amortized-time decrease-key operations, and others do not. In Automata, Languages, and Programming - 41st International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8-11, 2014, Proceedings, Part I, pages 637-649, 2014. URL:
  18. John Iacono and Mark Yagnatinsky. A Linear Potential Function for Pairing Heaps, pages 489-504. Springer International Publishing, Cham, 2016. URL:
  19. Haim Kaplan and Robert Endre Tarjan. Thin heaps, thick heaps. ACM Trans. Algorithms, 4(1):3:1-3:14, 2008. URL:
  20. Irit Katriel, Peter Sanders, and Jesper Larsson Träff. A practical minimum spanning tree algorithm using the cycle property. In Algorithms - ESA 2003, 11th Annual European Symposium, Budapest, Hungary, September 16-19, 2003, Proceedings, pages 679-690, 2003. URL:
  21. Donald E. Knuth. The Art of Computer Programming, Volume 1 (3rd Ed.): Fundamental Algorithms. Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA, 1997. Google Scholar
  22. Daniel H. Larkin, Siddhartha Sen, and Robert Endre Tarjan. A back-to-basics empirical study of priority queues. In 2014 Proceedings of the Sixteenth Workshop on Algorithm Engineering and Experiments, ALENEX 2014, Portland, Oregon, USA, January 5, 2014, pages 61-72, 2014. URL:
  23. Bernard M. E. Moret and Henry D. Shapiro. An empirical analysis of algorithms for constructing a minimum spanning tree, pages 400-411. Springer Berlin Heidelberg, Berlin, Heidelberg, 1991. URL:
  24. Seth Pettie. Towards a final analysis of pairing heaps. In 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2005), 23-25 October 2005, Pittsburgh, PA, USA, Proceedings, pages 174-183, 2005. URL:
  25. Seth Pettie. Thirteen ways of looking at a splay tree. Unpublished lecture, 2014. Google Scholar
  26. Daniel Dominic Sleator and Robert Endre Tarjan. Self-adjusting binary search trees. J. ACM, 32(3):652-686, 1985. URL:
  27. John T. Stasko and Jeffrey Scott Vitter. Pairing heaps: Experiments and analysis. Commun. ACM, 30(3):234-249, 1987. URL:
  28. Ashok Subramanian. An explanation of splaying. J. Algorithms, 20(3):512-525, 1996. URL:
  29. Jean Vuillemin. A data structure for manipulating priority queues. Commun. ACM, 21(4):309-315, 1978. URL: