当前位置:网站首页>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
边栏推荐
- B_ QuRT_ User_ Guide(39)
- The for loop realizes 1-100 addition and eliminates the 4-digit tail number
- Idea automatically generates serialVersionUID
- Experience sharing of system architecture designers in preparing for the exam: the direction of paper writing
- KeePass realizes automatic input of web pages
- 2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
- Flash encryption process and implementation of esp32
- How to change the formula picture in the paper directly into the formula in word
- Svn relocation
- ASP. Net open web page
猜你喜欢
Unity3d learning notes 5 - create sub mesh
Understand TCP's three handshakes and four waves with love
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Summary of SQL single table query 2020.7.27
2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
Deep understanding of MySQL lock and transaction isolation level
C method question 1
城联优品作为新力量初注入,相关上市公司股价应声上涨150%
[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
Interface
随机推荐
B_QuRT_User_Guide(38)
Oracle string sorting
Ora-02437 failed to verify the primary key violation
B_QuRT_User_Guide(36)
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
C simple question 2
The for loop realizes 1-100 addition and eliminates the 4-digit tail number
Interface
SRM supplier cloud collaborative management platform solution for building materials industry to realize business application scalability and configuration
SAP HR labor contract information 0016
IDEA 2021.3. X cracking
S2b2b mall solution of intelligent supply chain in packaging industry: opening up a new ecosystem of e-commerce consumption
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
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
FPGA basics catalog
Coreseek: the second step is index building and testing
SAP memory parameter tuning process
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
Cloud native data warehouse analyticdb MySQL user manual
sql 数据库执行问题