当前位置:网站首页>Rotation of AVL tree
Rotation of AVL tree
2022-06-09 22:10:00 【sy2453】
Catalog
Selection of single rotation and double rotation :
Selection of single rotation and double rotation :
Left spin
Right single spin
Right left double rotation
Double left and right
AVL Verification of trees
- AVL The tree is based on the binary search tree and adds the restriction of balance , So verify AVL Trees , There are two steps :
- 1. Verify that it is a binary search tree
- If the middle order traversal can get an ordered sequence , It is explained as a binary search tree
- 2. Verify that it is a balanced tree
- The absolute value of the height difference of each node subtree shall not exceed 1( Note that if there is no balance factor in the node )
- Whether the balance factor of the node is calculated correctly

- Special scenes 2
- {4, 2, 6, 1, 3, 5, 15, 7, 16, 14}
- The value found during validation is 6 There is an error in the balance factor of the node , The balance factor should have been -1, But the result is 0;
- Cause analysis :
- Right left double rotation :
- Problem solving :
- You can rotate it according to SubRL The equilibrium factor of , Modify the rotation after it is completed :

- Double left and right
- Problem solving :
- You can rotate it according to SubLR The equilibrium factor of , Modify the rotation after it is completed :

- Right left double rotation :
- 1. Verify that it is a binary search tree
- AVL Complex tree implementation :
- 1. The implementation is more complex , because AVL Maintain the balance factor for nodes in , The balance factor needs to be updated after each insertion , After the double rotation is completed, the balance factor also needs to be updated
- 2. Delete : The most inserted case should always be updated or rotated to the root position
边栏推荐
- spider pi 智能视觉六足机器人 颜色追踪 人脸识别 0604
- 工业互联网+危化安全生产数字化综合管理云平台
- FPN-Feature Pyramid Network
- Actions before purchasing memory modules
- 中金证券开户怎么样?安全吗?开户
- Discussion on solving LCA by multiplication method
- Digital integrated management system of double prevention system in chemical enterprises
- [play with Huawei cloud] initial experience of MapReduce service
- How to search for keywords in Oracle tables?
- 体系化目标一健身合辑
猜你喜欢

Cremb Pro backend sub administrator 403 problem analysis

线程池

工业互联网+危化安全生产数字化综合管理云平台

Second cloud cloud's original fully compatible solution for information innovation promotes the acceleration of the implementation of information innovation industry

Spider PI intelligent vision hexapod robot in direct connection mode 0603

Design of spectrum analyzer based on nexys3 VHDL board

稍微复杂的查询

浏览器从下载到渲染整个流程

Case study on infrared meter reading project of energy equipment intelligent system platform construction

Design and Simulation of SD card reading and writing based on FPGA Verilog
随机推荐
typedef&enum&C数据类型
Deep learning and CV tutorial (13) | target detection (SSD, Yolo Series)
spider pi 智能视觉六足机器人 开箱介绍 0602
10 minute quick start RDS [Huawei cloud to jianzhiyuan]
校园锐捷路由器使用指南
PostgreSQL recently Common Table structure Query statements
sqlserver2012 不允许修改表结构的问题解决 0607
spider pi 智能视觉六足机器人 vnc连接机器人 0603
Design of spectrum analyzer based on nexys3 VHDL board
Spider PI intelligent vision hexapod robot color recognition function 0603
Spider PI intelligent vision hexapod robot VNC connecting robot 0603
汛期建筑施工现场安全生产风险智能防控
JS auto increment and auto decrement (unary operator)
如何定比特到服務器CPU飆高的原因
Design and Simulation of SD card reading and writing based on FPGA Verilog
YOLO系列目标检测后处理-非极大值抑制
Spider PI intelligent vision hexapod robot patrol function 0603
Bonner barcode reader ve205g1a
After several twists and turns, how long can the TSDB C-bit of incluxdb last?
An RS485 serial interface current sensor snap on type mutual inductor supports Modbus communication protocol













