当前位置:网站首页>平衡二叉树【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、删除

边栏推荐
- SQL database execution problems
- B_ QuRT_ User_ Guide(37)
- C inheritance and interface design polymorphism
- Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
- MySQL Index Optimization Practice I
- Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels
- Flash encryption process and implementation of esp32
- 0-1 knapsack problem
- The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
- LDO voltage stabilizing chip - internal block diagram and selection parameters
猜你喜欢

高效的S2B2C电商系统,是这样帮助电子材料企业提升应变能力的

移动端异构运算技术 - GPU OpenCL 编程(基础篇)

2021icpc Shanghai h.life is a game Kruskal reconstruction tree

Puce à tension stabilisée LDO - schéma de bloc interne et paramètres de sélection du modèle

B_QuRT_User_Guide(36)

Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process

B_ QuRT_ User_ Guide(36)

Understand TCP's three handshakes and four waves with love

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

What if once again forgets the login password of raspberry pie? And you don't have a monitor yet! Today, I would like to introduce a method
随机推荐
欢聚时代一面
Explain
B_QuRT_User_Guide(36)
ESP at installation esp8266 and esp32 versions
C # exchange number, judge to pass the exam
SAP memory parameter tuning process
Sequence of entity layer, Dao layer, service layer and controller layer
Unity3d Learning Notes 6 - GPU instantiation (1)
伸展树(一) - 图文解析与C语言实现
Lm12 rolling heikin Ashi double K-line filter
Design and implementation of spark offline development framework
How to login and enable synchronization function in Google browser
Entity层、DAO层、Service层、Controller层 先后顺序
Markdown
SAP HR 社会工作经历 0023
[untitled]
How to change the formula picture in the paper directly into the formula in word
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
LDO穩壓芯片-內部框圖及選型參數
UE4_ Use of ue5 blueprint command node (turn on / off screen response log publish full screen display)