The traditional algorithm for AVL tree rebalancing is the rotation method, which uses methods of left-rotation, right-rotation, left first rotation then right and right first rotation then left to deal with the different unbalance structures respectively. In fact, it is more simple to solve imbalance using the obvious characteristic of AVL tree that "middle for the root, smaller for the left and bigger for the right", and the balance-factors can be found directly. Based on this idea we propose the selection method, which chooses the smaller, middle and bigger nodes from the unbalanced structure and reform them to that balanced state. We have a symmetry analyzation and description on both inserting and deleting. The whole algorithm is non-recursion. Our experimental result verifies that the construction time of the selection method decreases over 20% than that of the rotation method and the destruction time decreases over 13% when the number of nodes exceeds 100,000.
ZHU Yu
,
ZHANG Hong-Bin
. Selection Method for AVL Tree Rebalancing[J]. Journal of University of Chinese Academy of Sciences, 2006
, 23(4)
: 527
-533
.
DOI: 10.7523/j.issn.2095-6134.2006.4.015