skip to main content
research-article
Public Access

Deletion Without Rebalancing in Binary Search Trees

Published: 02 September 2016 Publication History

Abstract

We address the vexing issue of deletions in balanced trees. Rebalancing after a deletion is generally more complicated than rebalancing after an insertion. Textbooks neglect deletion rebalancing, and many B-tree--based database systems do not do it. We describe a relaxation of AVL trees in which rebalancing is done after insertions but not after deletions, yet worst-case access time remains logarithmic in the number of insertions. For any application of balanced trees in which the number of updates is polynomial in the tree size, our structure offers performance competitive with that of classical balanced trees. With the addition of periodic rebuilding, the performance of our structure is theoretically superior to that of many, if not all, classic balanced tree structures. Our structure needs lg lg m+ 1 bits of balance information per node, where m is the number of insertions and lg is the base-two logarithm, or lg lg n+ O(1) with periodic rebuilding, where n is the number of nodes. An insertion takes up to two rotations and O(1) amortized time, not counting the time to find the insertion position. This is the same as in standard AVL trees. Using an analysis that relies on an exponential potential function, we show that rebalancing steps occur with a frequency that is exponentially small in the height of the affected node. Our techniques apply to other types of balanced trees, notably B-trees, as we show in a companion article, and particularly red-black trees, which can be viewed as a special case of B-trees.

References

[1]
Lada A. Adamic and Bernardo A. Huberman. 2002. Zipf’s law and the Internet. Glottometrics 3, 143--150.
[2]
G. M. Adel’son-Vel’skii and E. M. Landis. 1962. An algorithm for the organization of information. Soviet Mathematics Doklady 3, 1259--1262.
[3]
Arne Andersson. 1993. Balanced search trees made simple. In Proceedings of the WADS Conference (WADS’93). 60--71.
[4]
Rudolf Bayer. 1971. Binary B-trees for virtual memory. In Proceedings of the SIGFIDET Conference (SIGFIDET’71). 219--235.
[5]
Rudolf Bayer. 1972. Symmetric binary B-trees: Data structure and maintenance algorithms. Acta Informatica 1, 290--306.
[6]
Joan Boyar, Rolf Fagerberg, and Kim S. Larsen. 1997. Amortization results for chromatic search trees, with an application to priority queues. Journal of Computer and System Sciences 55, 3, 504--521.
[7]
Nathan Grasso Bronson, Jared Casper, Hassan Chafi, and Kunle Olukotun. 2010. A practical concurrent binary search tree. In Proceedings of the PPoPP Conference (PPoPP’10). 257--268.
[8]
J. Culberson and J. I. Munro. 1989. Explaining the behaviour of binary search trees under prolonged updates: A model and simulations. Computer Journal 32, 1, 68--75.
[9]
J. B. Estoup. 1916. Gammes Stenographiques (4th ed.). Paris Institut Stenographique, Paris, France.
[10]
Caxton C. Foster. 1965. A Study of AVL Trees. Technical Report GER-12158. Goodyear Aerospace Corporation, Akron, OH.
[11]
M. L. Fredman, R. Sedgewick, D. D. Sleator, and R. E. Tarjan. 1986. The pairing heap: A new form of self-adjusting heap. Algorithmica 1, 1, 111--129.
[12]
J. Gray and A. Reuter (Eds.). 1993. B-trees. In Transaction Processing: Concepts and Techniques. Morgan Kaufmann, San Mateo, CA, 851--876.
[13]
Leo J. Guibas and Robert Sedgewick. 1978. A dichromatic framework for balanced trees. In Proceedings of the FOCS Conference (FOCS’78). 8--21.
[14]
Bernhard Haeupler, Siddhartha Sen, and Robert E. Tarjan. 2009. Rank-balanced trees. In Proceedings of the WADS Conference (WADS’09). 351--362.
[15]
Bernhard Haeupler, Siddhartha Sen, and Robert E. Tarjan. 2015. Rank-balanced trees. ACM Transactions on Algorithms 11, 4, 30:1--30:26.
[16]
Sabine Hanke, Thomas Ottmann, and Eljas Soisalon-Soininen. 1997. Relaxed balanced red-black trees. In Proceedings of the CIAC Conference (CIAC’97). 193--204.
[17]
Joep L. W. Kessels. 1983. On-the-fly optimization of data structures. Communications of the ACM 26, 11, 895--901.
[18]
David Hong Kyun Kim. 2010. Deletions Without Rebalancing in Red Black Trees. Undergraduate Junior Thesis, Department of Mathematics, Princeton University, Princeton, NJ.
[19]
Donald E. Knuth. 1973. The Art of Computer Programming, Volume 3: Sorting and Searching. Addison-Wesley.
[20]
K. S. Larsen and R. Fagerberg. 1996. Efficient rebalancing of B-trees with relaxed balance. International Journal of Foundations of Computer Science 7, 2, 169--186.
[21]
Kurt Mehlhorn and Athanasios Tsakalidis. 1986. An amortized analysis of insertions into AVL-trees. SIAM Journal on Computing 15, 1, 22--33.
[22]
J. Metzger. 1975. Managing Simultaneous Operations in Large Ordered Indexes. Technical Report. Technische Universität München, Institut für Informatik, TUM-Math.
[23]
J. Nievergelt and E. M. Reingold. 1973. Binary search trees of bounded balance. SIAM Journal on Computing 2, 1, 33--43.
[24]
Otto Nurmi and Eljas Soisalon-Soininen. 1996. Chromatic binary search trees: A structure for concurrent rebalancing. Acta Informatica 33, 6, 547--557.
[25]
O. Nurmi, E. Soisalon-Soininen, and D. Wood. 1987. Concurrency control in database structures with relaxed balance. In Proceedings of the PODS Conference (PODS’87). 170--176.
[26]
Henk J. Olivié. 1982. A new class of balanced search trees: Half balanced binary search trees. Information Theory and Applications 16, 1, 51--71.
[27]
Michael A. Olson, Keith Bostic, and Margo I. Seltzer. 1999. Berkeley DB. In Proceedings of the USENIX Conference: FREENIX Track. 183--191.
[28]
Michael A. Olson, Keith Bostic, and Margo I. Seltzer. 2000. Berkeley DB.
[29]
Behrokh Samadi. 1976. B-trees in a system with multiple users. Information Processing Letters 5, 4, 107--112.
[30]
Neil Sarnak and Robert E. Tarjan. 1986. Planar point location using persistent search trees. Communications of the ACM 29, 7, 669--679.
[31]
Robert Sedgewick. 2008. Left-Leaning Red-Black Trees. Retrieved July 14, 2016, from http://www.cs.princeton.edu/∼rs/talks/LLRB/LLRB.pdf.
[32]
Siddhartha Sen and Robert E. Tarjan. 2009. Deletion without rebalancing in multiway search trees. In Proceedings of the ISAAC Conference (ISAAC’09). 832--841.
[33]
Siddhartha Sen and Robert E. Tarjan. 2010. Deletion without rebalancing in balanced binary trees. In Proceedings of the SODA Conference (SODA’10). 1490--1499.
[34]
Siddhartha Sen and Robert E. Tarjan. 2014. Deletion without rebalancing in multiway search trees. ACM Transactions on Database Systems 39, 1, 8:1--8:14.
[35]
Daniel Dominic Sleator and Robert Endre Tarjan. 1985. Self-adjusting binary search trees. Journal of the ACM 32, 3, 652--686.
[36]
Robert Endre Tarjan. 1979. A class of algorithms which require nonlinear time to maintain disjoint sets. Journal of Computer and System Sciences 18, 2, 110--127.
[37]
Robert Endre Tarjan. 1983. Updating a balanced search tree in O(1) rotations. Information Processing Letters 16, 5, 253--257.
[38]
Robert Endre Tarjan. 1985a. Amortized computational complexity. SIAM Journal on Algebraic Discrete Methods 6, 306--318.
[39]
Robert Endre Tarjan. 1985b. Efficient Top-Down Updating of Red-Black Trees. Technical Report TR-006-85. Department of Computer Science, Princeton University, Princeton, NJ.
[40]
Mark A. Weiss. 2011. Data Structures and Algorithm Analysis in Java (3rd ed.). Addison Wesley.
[41]
S. Yang and R. E. Tarjan. 2014. Eager and lazy deletion rebalancing in binary search trees. Unpublished manuscript.
[42]
G. K. Zipf. 1932. Selected Studies of the Principle of Relative Frequency in Language. Harvard University Press, Cambridge, MA.

Cited By

View all
  • (2024)Scaling Up Transactions with Slower ClocksProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638472(2-16)Online publication date: 2-Mar-2024
  • (2024)Exploiting Flat Namespace to Improve File System Metadata Performance on Ultra-Fast, Byte-Addressable NVMsACM Transactions on Storage10.1145/362067320:1(1-47)Online publication date: 30-Jan-2024
  • (2024)Revisiting 2–3 red–black trees with a pedagogically sound yet efficient deletion algorithm: parity-seekingActa Informatica10.1007/s00236-023-00452-661:3(199-229)Online publication date: 1-Sep-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Algorithms
ACM Transactions on Algorithms  Volume 12, Issue 4
September 2016
310 pages
ISSN:1549-6325
EISSN:1549-6333
DOI:10.1145/2983296
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 September 2016
Accepted: 01 March 2016
Revised: 01 February 2016
Received: 01 April 2015
Published in TALG Volume 12, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Balanced trees
  2. algorithm
  3. amortized complexity
  4. data structure
  5. database access methods
  6. exponential potential function

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

  • AFOSR MURI grant
  • NSF
  • US-Israel Binational Science Foundation

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)366
  • Downloads (Last 6 weeks)15
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Scaling Up Transactions with Slower ClocksProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638472(2-16)Online publication date: 2-Mar-2024
  • (2024)Exploiting Flat Namespace to Improve File System Metadata Performance on Ultra-Fast, Byte-Addressable NVMsACM Transactions on Storage10.1145/362067320:1(1-47)Online publication date: 30-Jan-2024
  • (2024)Revisiting 2–3 red–black trees with a pedagogically sound yet efficient deletion algorithm: parity-seekingActa Informatica10.1007/s00236-023-00452-661:3(199-229)Online publication date: 1-Sep-2024
  • (2021)The Unit Re-Balancing ProblemMathematics10.3390/math92432059:24(3205)Online publication date: 11-Dec-2021
  • (2018)To-many or to-one? all-in-one! efficient purely functional multi-maps with type-heterogeneous hash-triesACM SIGPLAN Notices10.1145/3296979.319242053:4(283-295)Online publication date: 11-Jun-2018
  • (2018)To-many or to-one? all-in-one! efficient purely functional multi-maps with type-heterogeneous hash-triesProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192420(283-295)Online publication date: 11-Jun-2018
  • (2017)Flexible data views: design and implementationProceedings of the 4th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming10.1145/3091966.3091970(25-32)Online publication date: 18-Jun-2017

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media