algorithm - AVL树删除

标签 algorithm data-structures binary-search-tree avl-tree

Find an example AVL tree such that removing a single (specific) value from the tree causes rebalancing to occur starting at two different nodes.

我有这个作为我的家庭作业问题。我知道什么是AVL树,但是我不明白上面的问题。有人可以解释一下吗?

在两个不同的节点重新平衡是否意味着需要两次旋转来修复树?

最佳答案

AVL 重新平衡操作是指特定节点需要应用单旋转或双旋转来纠正树中的不平衡的时候。我认为问题是要求您找到一种情况,在这种情况下,在 AVL 树中进行单轮或双轮旋转可以局部修复平衡,但随后需要在树中更高的节点上执行重新平衡操作。

希望这对您有所帮助!

关于algorithm - AVL树删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15484287/

相关文章:

algorithm - 围绕给定点生成距离网格

python - 每个键都有唯一可能值的字典?

python - 将新的字典值列添加到 pandas 数据框中

algorithm - 在列表中查找重复组合

algorithm - 为什么此代码中需要这一行才能从 BST 中删除?

algorithm - 关于二叉搜索树的问题?

algorithm - 递归是循环吗

java - 在电梯中实现优先队列

algorithm - Splay tree 现实生活中的应用

Java冒泡排序算法实现