AVL树删除 [英] AVL tree delete

查看:76
本文介绍了AVL树删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查找示例AVL树,以便从树中删除单个(特定)值导致重新平衡从两个不同的节点开始.

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

这是我的家庭作业问题.我知道什么是AVL树,但是我不明白上面的问题.有人可以照亮吗?

I have this as my homework question. I know what AVL tree is, but I don't understand the above question. Can some one shed light?

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

Does rebalancing at two different nodes mean that two rotations are needed to fix the tree?

推荐答案

AVL重新平衡操作是特定节点需要应用一次或两次旋转以纠正树中不平衡的时间.我认为问题在于,您要寻找一种情况,其中在AVL树中进行单旋转或双旋转会局部固定平衡,但随后需要在树中较高的节点上执行重新平衡操作.

An AVL rebalance operation is a time when a particular node needs to have either a single or double rotation applied to correct the imbalance in the tree. I think the question is asking you to find a case where doing a single or double rotation within an AVL tree locally fixes the balance, but then requires a rebalance operation to be performed at a node higher up in the tree.

希望这会有所帮助!

这篇关于AVL树删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆