Welcome to Journal of University of Chinese Academy of Sciences,Today is

›› 2006, Vol. 23 ›› Issue (4): 527-533.DOI: 10.7523/j.issn.2095-6134.2006.4.015

• 论文 • Previous Articles     Next Articles

Selection Method for AVL Tree Rebalancing

ZHU Yu, ZHANG Hong-Bin   

  1. 1 Tsinghua University

    2 Graduate School of Chinese Academy of Sciences

  • Received:1900-01-01 Revised:1900-01-01 Online:2006-07-15

Abstract: 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.

Key words: AVL tree, the selection method, the aceess path, direction, non-recursion

CLC Number: