Bottom-up rebalancing binary search trees by flipping a coin

IF 1 4区 计算机科学 Q3 COMPUTER SCIENCE, THEORY & METHODS
Gerth Stølting Brodal
{"title":"Bottom-up rebalancing binary search trees by flipping a coin","authors":"Gerth Stølting Brodal","doi":"10.1016/j.tcs.2025.115543","DOIUrl":null,"url":null,"abstract":"<div><div>Rebalancing schemes for dynamic binary search trees are numerous in the literature, where the goal is to maintain trees of low height, either in the worst-case or expected sense. In this paper we study randomized rebalancing schemes for sequences of <span><math><mi>n</mi></math></span> insertions into an initially empty binary search tree, under the assumption that a tree only stores the elements and the tree structure without any additional balance information. Seidel (2009) presented a top-down randomized insertion algorithm, where insertions take expected <span><math><mrow><mi>O</mi><mo>(</mo><msup><mi>lg</mi><mn>2</mn></msup><mi>n</mi><mo>)</mo></mrow></math></span> time, and the resulting trees have the same distribution as inserting a uniform random permutation of <span><math><mi>n</mi></math></span> elements into a binary search tree without rebalancing. Seidel states as an open problem if a similar result can be achieved with bottom-up insertions. In this paper we fail to answer this question.</div><div>We consider two simple canonical randomized bottom-up insertion algorithms on binary search trees, assuming that an insertion is given the position where to insert the next element. The subsequent rebalancing is performed bottom-up in expected <span><math><mrow><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></mrow></math></span> time, uses expected <span><math><mrow><mi>O</mi><mo>(</mo><mn>1</mn><mo>)</mo></mrow></math></span> random bits, performs at most two rotations, and the rotations appear with geometrically decreasing probability in the distance from the leaf. For some insertion sequences the expected depth of each node is proved to be <span><math><mrow><mi>O</mi><mo>(</mo><mi>lg</mi><mi>n</mi><mo>)</mo></mrow></math></span>. On the negative side, we prove for both algorithms that there exist simple insertion sequences where the expected depth is <span><math><mrow><mstyle><mi>Ω</mi></mstyle><mo>(</mo><mi>n</mi><mo>)</mo></mrow></math></span>, i.e., the studied rebalancing schemes are <em>not</em> competitive with (most) other rebalancing schemes in the literature.</div></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":"1055 ","pages":"Article 115543"},"PeriodicalIF":1.0000,"publicationDate":"2025-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397525004815","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

Abstract

Rebalancing schemes for dynamic binary search trees are numerous in the literature, where the goal is to maintain trees of low height, either in the worst-case or expected sense. In this paper we study randomized rebalancing schemes for sequences of n insertions into an initially empty binary search tree, under the assumption that a tree only stores the elements and the tree structure without any additional balance information. Seidel (2009) presented a top-down randomized insertion algorithm, where insertions take expected O(lg2n) time, and the resulting trees have the same distribution as inserting a uniform random permutation of n elements into a binary search tree without rebalancing. Seidel states as an open problem if a similar result can be achieved with bottom-up insertions. In this paper we fail to answer this question.
We consider two simple canonical randomized bottom-up insertion algorithms on binary search trees, assuming that an insertion is given the position where to insert the next element. The subsequent rebalancing is performed bottom-up in expected O(1) time, uses expected O(1) random bits, performs at most two rotations, and the rotations appear with geometrically decreasing probability in the distance from the leaf. For some insertion sequences the expected depth of each node is proved to be O(lgn). On the negative side, we prove for both algorithms that there exist simple insertion sequences where the expected depth is Ω(n), i.e., the studied rebalancing schemes are not competitive with (most) other rebalancing schemes in the literature.
通过抛硬币自下而上重新平衡二叉搜索树
动态二叉搜索树的再平衡方案在文献中有很多,其目标是保持树的低高度,无论是在最坏情况下还是在预期意义上。本文研究了初始空二叉搜索树中n个插入序列的随机再平衡方案,假设树只存储元素和树结构,没有任何额外的平衡信息。Seidel(2009)提出了一种自顶向下的随机插入算法,其中插入的预期时间为O(lg2n),所得到的树的分布与在二叉搜索树中插入n个元素的均匀随机排列而不进行再平衡的分布相同。Seidel表示,如果自下而上的插入可以获得类似的结果,则这是一个开放问题。在本文中,我们没有回答这个问题。我们考虑在二叉搜索树上的两种简单的规范随机自底向上插入算法,假设插入是给定插入下一个元素的位置。随后的再平衡在预期的O(1)时间内自下而上执行,使用预期的O(1)个随机比特,最多执行两次旋转,并且旋转在距离叶子的距离上以几何级数递减的概率出现。对于某些插入序列,证明了每个节点的期望深度为O(lgn)。在消极方面,我们证明了两种算法都存在期望深度为Ω(n)的简单插入序列,即所研究的再平衡方案与文献中(大多数)其他再平衡方案不具有竞争力。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Theoretical Computer Science
Theoretical Computer Science 工程技术-计算机:理论方法
CiteScore
2.60
自引率
18.20%
发文量
471
审稿时长
12.6 months
期刊介绍: Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信