AVL树木的摊销轮换成本
Amortized Rotation Cost in AVL Trees
摘要:
AVL树是平衡二叉查找树的原始类型。在$n$ -节点AVL树中的插入最多需要两次旋转,但在$n$ -节点AVL树中的删除可能需要$Θ(\log n)$ .一个自然的问题是,删除是否可以进行多次旋转,不仅在最坏的情况下,而且在摊销的情况下。$n$节点树中的一系列$n$连续删除需要进行$O(n)$旋转,但是当插入与删除混合时会发生什么呢?Heaupler、Sen和Tarjan指出,在$n$节点AVL树中交替插入和删除可以导致每个删除进行$Ω(\log n)$旋转,但他们没有提供任何结构来证明他们的主张。我们提供了这样一个建设:我们表明,对于无限多$n$,有一组$E$ { \it昂贵} $n$ -节点AVL树的属性,在$E$中的任何树,删除一定的叶子,然后重新插入它产生一个树在$E$,删除已经做了$Θ(\log n)$旋转。可以做任意数量的这样昂贵的删除-插入对。获得这样一个结构的困难在于,一般来说,由昂贵的删除-插入对产生的树不是原始树。实际上,如果$E$中的树具有偶数高度$k$,则需要$2^{k/2}$删除-插入对来再现原始树。
英文摘要:
An AVL tree is the original type of balanced binary search tree. An insertion in an $n$-node AVL tree takes at most two rotations, but a deletion in an $n$-node AVL tree can take $Θ(\log n)$. A natural question is whether deletions can take many rotations not only in the worst case but in the amortized case as well. A sequence of $n$ successive deletions in an $n$-node tree takes $O(n)$ rotations, but what happens when insertions are intermixed with deletions? Heaupler, Sen, and Tarjan conjectured that alternating insertions and deletions in an $n$-node AVL tree can cause each deletion to do $Ω(\log n)$ rotations, but they provided no construction to justify their claim. We provide such a construction: we show that, for infinitely many $n$, there is a set $E$ of {\it expensive} $n$-node AVL trees with the property that, given any tree in $E$, deleting a certain leaf and then reinserting it produces a tree in $E$, with the deletion having done $Θ(\log n)$ rotations. One can do an arbitrary number of such expensive deletion-insertion pairs. The difficulty in obtaining such a construction is that in general the tree produced by an expensive deletion-insertion pair is not the original tree. Indeed, if the trees in $E$ have even height $k$, $2^{k/2}$ deletion-insertion pairs are required to reproduce the original tree.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。