arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.08287cs.DS
收藏

通过抛硬币实现自底向上再平衡的二叉搜索树

Bottom-up Rebalancing Binary Search Trees by Flipping a Coin

Gerth Stølting Brodal

AI总结:

针对Seidel提出的自底向上随机插入二叉搜索树能否达到自顶向下方案效果的开放问题,本文研究两种自底向上随机再平衡算法,发现其部分场景下节点期望深度为O(lg n),但存在插入序列使期望深度达Ω(n),不具备竞争力。

摘要:

文献中已有大量动态二叉搜索树的再平衡方案,其目标是在最坏情况或期望意义下维持低高度的树。本文研究向初始为空的二叉搜索树中进行n次插入操作的随机再平衡方案,假设树仅存储元素和树结构,不携带任何额外的平衡信息。Seidel(2009)提出了一种自顶向下的随机插入算法,该算法的插入操作期望时间复杂度为O(lg²n),且生成的树与将均匀随机排列插入无再平衡的二叉搜索树所得的树具有相同的分布。Seidel将能否通过自底向上插入实现类似结果列为一个开放问题。本文未能解答该问题。\n我们研究了二叉搜索树上两种简单的典型随机自底向上插入算法,假设插入操作已获知下一个元素的插入位置。后续的再平衡以自底向上方式执行,期望时间复杂度为O(1),期望使用O(1)个随机比特,最多执行两次旋转,且旋转出现的概率随其与叶子节点距离的增加呈几何级下降。对于部分插入序列,已证明每个节点的期望深度为O(lg n)。在负面结果方面,我们证明对于这两种算法,都存在简单的插入序列使得期望深度为Ω(n),即所研究的再平衡方案与文献中(大多数)其他再平衡方案相比不具备竞争力。

英文摘要:

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\big(\lg^2 n\big)$ time, and the resulting trees have the same distribution as inserting a uniform random permutation 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(\lg n)$. 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 \emph{not} competitive with (most) other rebalancing schemes in the literature.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑