当前位置:网站首页>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
边栏推荐
- Caip2021 preliminary VP
- v-for遍历对象
- Coreseek: the second step is index building and testing
- B_QuRT_User_Guide(36)
- Freelink open source call center design idea
- Three questions TDM
- Cloud native data warehouse analyticdb MySQL user manual
- Unity3d Learning Notes 6 - GPU instantiation (1)
- Slam interview summary
- Happy gathering time
猜你喜欢
Deep understanding of MySQL lock and transaction isolation level
B_ QuRT_ User_ Guide(37)
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
[compilation principle] lexical analysis design and Implementation
USB (XV) 2022-04-14
建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
B_QuRT_User_Guide(36)
As a new force, chenglian premium products was initially injected, and the shares of relevant listed companies rose 150% in response
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
C number of words, plus ¥, longest word, average value
随机推荐
The 19th Zhejiang Provincial College Programming Contest 2022 f.easyfix chairman tree
Explain
Three questions TDM
JNI uses asan to check memory leaks
【汇总】看过的一些Panel与视频
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
Happy gathering time
平衡二叉树【AVL树】——插入、删除
SLAM面试总结
2022第六季完美童模陕西总决赛圆满落幕
As a new force, chenglian premium products was initially injected, and the shares of relevant listed companies rose 150% in response
Experience sharing of system architecture designers in preparing for the exam: the direction of paper writing
2022 届的应届生都找到工作了吗?做自媒体可以吗?
Stringutils tool class
B_ QuRT_ User_ Guide(40)
Spark 离线开发框架设计与实现
SAP HR labor contract information 0016
MySQL Index Optimization Practice II
C simple question 2
C # exchange number, judge to pass the exam