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

边栏推荐
- Summary of common methods of object class (September 14, 2020)
- C cat and dog
- B_QuRT_User_Guide(36)
- SAP HR reward and punishment information export
- Oracle statistics by time
- 【7.4】25. K 个一组翻转链表
- Three questions TDM
- Navicat connects Oracle
- The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
- Open source hardware small project: anxinco esp-c3f control ws2812
猜你喜欢

Ora-02437 failed to verify the primary key violation

进度播报|广州地铁七号线全线29台盾构机全部完成始发

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

Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels

Unity3d Learning Notes 6 - GPU instantiation (1)

SAP HR reward and punishment information export

Extended tree (I) - graphic analysis and C language implementation

New potential energy of industrial integration, Xiamen station of city chain technology digital summit successfully held

List. How to achieve ascending and descending sort() 2020.8.6

Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
随机推荐
JNI uses asan to check memory leaks
FPGA basics catalog
给出一个数组,如 [7864, 284, 347, 7732, 8498],现在需要将数组中的数字拼接起来,返回「最大的可能拼出的数字」
Summary of SQL single table query 2020.7.27
2022第六季完美童模陕西总决赛圆满落幕
产业共融新势能,城链科技数字峰会厦门站成功举办
Anxin vb01 offline voice module access intelligent curtain guidance
SAP memory parameter tuning process
Interface
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
Matlab SEIR infectious disease model prediction
USB (XVI) 2022-04-28
Class C design questions
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
IDEA 2021.3. X cracking
Tree background data storage (using webmethod) [easy to understand]
MySQL架构
[stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
0-1 knapsack problem