当前位置:网站首页>Balanced binary tree [AVL tree] - insert, delete
Balanced binary tree [AVL tree] - insert, delete
2022-07-07 23:37:00 【yyy_ zxc】
1、 Average search length ( Tree height ):
2、 The equilibrium factor of the node = Left subtree height - The right tree is tall
The equilibrium factor of a balanced binary tree node can only be 0,1 or -1
2、 Insert
2.1 The object of each adjustment is “ Minimum unbalanced subtree ”
2.2 Adjust the minimum unbalanced subtree A
①LL【A Left child right up spin 】: stay A The left child's insertion in the left subtree leads to imbalance
②RR【A The right child rotates upward on the left 】: stay A Insertion into the right subtree of the right child leads to imbalance
③LR【A The left child's right child first turns left and then right 】:
stay A The insertion in the right subtree of the left child leads to imbalance
④RL【A The left child of the right child rotates right and then left 】:
stay A The insertion of the right child into the left subtree leads to imbalance
【 notes 】 Each rotation will cause the child to become a father , Father becomes a child
【 notes 】 Only a left child can turn right up
Only the right child can rotate up to the left
3、 Delete
边栏推荐
- MySQL架构
- Anxin vb01 offline voice module access intelligent curtain guidance
- SAP HR family member information
- 电子设备行业智能供应链协同平台解决方案:解决低效, 赋能产业数字化升级
- Oracle statistics by time
- Idea automatically generates serialVersionUID
- Count the top 10 films at the box office and save them in another file
- Coreseek: the second step is index building and testing
- SAP HR 家庭成员信息
- 【7.5】15. 三数之和
猜你喜欢
First week of July
Oracle database backup and recovery
产业共融新势能,城链科技数字峰会厦门站成功举办
Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
高效的S2B2C电商系统,是这样帮助电子材料企业提升应变能力的
SAP HR family member information
MySQL Index Optimization Practice II
UE4_ Ue5 panoramic camera
Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process
建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
随机推荐
Installing gradle
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Right click the idea file to create new. There is no solution to create new servlet
sql 数据库执行问题
Live-Server使用
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
C method question 1
Oracle database backup and recovery
C cat and dog
Svn relocation
IDEA 2021.3. X cracking
Design and implementation of spark offline development framework
[untitled]
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
The file format and extension of XLS do not match
Stringutils tool class
B / Qurt Utilisateur Guide (36)
Summary of common methods of object class (September 14, 2020)
648. Word replacement
SAP memory parameter tuning process