当前位置:网站首页>平衡二叉樹【AVL樹】——插入、删除
平衡二叉樹【AVL樹】——插入、删除
2022-07-07 23:37: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、删除

边栏推荐
- 【实验分享】通过Console口登录到Cisco设备
- UE4_ Ue5 combined with Logitech handle (F710) use record
- SAP HR奖罚信息导出
- Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process
- The 19th Zhejiang Provincial College Programming Contest 2022 f.easyfix chairman tree
- Slam interview summary
- Flash encryption process and implementation of esp32
- USB (XIV) 2022-04-12
- ESP at installation esp8266 and esp32 versions
- B_ QuRT_ User_ Guide(38)
猜你喜欢

Unity3d Learning Notes 6 - GPU instantiation (1)

ASP. Net core middleware request processing pipeline

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

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

Installing gradle

SAP HR 家庭成员信息

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

Markdown

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

UE4_ Ue5 combined with Logitech handle (F710) use record
随机推荐
System design overview
Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels
Windows set redis to start automatically
C method question 1
Pycharm essential plug-in, change the background (self use, continuous update) | CSDN creation punch in
MySQL架构
As a new force, chenglian premium products was initially injected, and the shares of relevant listed companies rose 150% in response
ASP. Net core middleware request processing pipeline
List. How to achieve ascending and descending sort() 2020.8.6
【汇总】看过的一些Panel与视频
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
FPGA basics catalog
8.31 Tencent interview
SQL database execution problems
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
IDEA 2021.3. X cracking
【7.5】15. Sum of three numbers
First week of July
Summary of SQL single table query 2020.7.27
家用电器行业渠道商协同系统解决方案:助力家电企业快速实现渠道互联网化