当前位置:网站首页>平衡二叉树【AVL树】——插入、删除
平衡二叉树【AVL树】——插入、删除
2022-07-07 21:52:00 【yyy_zxc】
1、平均查找长度(树高):
2、结点的平衡因子=左子树高-右子树高
平衡二叉树结点的平衡因子只可能是0,1或-1

2、插入
2.1 每次调整的对象都是“最小不平衡子树”

2.2 调整最小不平衡子树A
①LL【A的左孩子右上旋】:在A的左孩子的左子树中插入导致不平衡
②RR【A的右孩子左上旋】:在A的右孩子的右子树中插入导致不平衡

③LR【A的左孩子的右孩子先左上旋再右上旋】:
在A的左孩子的右子树中插入导致不平衡

④RL【A的右孩子的左孩子先右上旋再左上旋】:
在A的右孩子的左子树中插入导致不平衡
【注】每次旋转都会导致这个孩子变成爹,爹变成孩子
【注】只有左孩子才能右上旋
只有右孩子才能左上旋

3、删除

边栏推荐
- Tree background data storage (using webmethod) [easy to understand]
- [compilation principle] lexical analysis design and Implementation
- 产业共融新势能,城链科技数字峰会厦门站成功举办
- Interface
- 【7.5】15. Sum of three numbers
- PCI-Express接口的PCB布线规则
- RE1 attack and defense world reverse
- B_QuRT_User_Guide(39)
- B_QuRT_User_Guide(37)
- HDU 4747 mex "recommended collection"
猜你喜欢

Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
![给出一个数组,如 [7864, 284, 347, 7732, 8498],现在需要将数组中的数字拼接起来,返回「最大的可能拼出的数字」](/img/21/2e99dd6173ab4925ec22290cd4a357.png)
给出一个数组,如 [7864, 284, 347, 7732, 8498],现在需要将数组中的数字拼接起来,返回「最大的可能拼出的数字」

B_ QuRT_ User_ Guide(36)

First week of July

Unity3d learning notes 5 - create sub mesh

LM12丨Rolling Heikin Ashi二重K线滤波器

包装行业智能供应链S2B2B商城解决方案:开辟电商消费新生态

Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function

ESP at installation esp8266 and esp32 versions

UE4_ Use of ue5 blueprint command node (turn on / off screen response log publish full screen display)
随机推荐
Mysql索引优化实战二
One week learning summary of STL Standard Template Library
Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
B_ QuRT_ User_ Guide(40)
SAP memory parameter tuning process
PCB wiring rules of PCI Express interface
Turbo introder common scripts
Entity层、DAO层、Service层、Controller层 先后顺序
Ros2 topic (03): the difference between ros1 and ros2 [01]
做自媒体视频剪辑怎么赚钱呢?
FPGA basics catalog
Extended tree (I) - graphic analysis and C language implementation
List. How to achieve ascending and descending sort() 2020.8.6
Caip2021 preliminary VP
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
B_QuRT_User_Guide(40)
C number of words, plus ¥, longest word, average value
The text editor of markdown class should add colors to fonts (including typora, CSDN, etc.)
2022第六季完美童模陕西总决赛圆满落幕
系统设计概述