Reprint to: http://blog.csdn.net/collonn/article/details/20128205
Diagram of the rotation operation of AVL tree most detailed
The major textbooks are all left-handed and right-handed, in fact, it is easy to understand the error, we change the term.
We call left-handed: Reverse needle rotation.
We call the right spin: shun the needle rotation.
The old rules , directly above the picture.
If I can not understand the rotation of the AVL tree, I can do nothing ...
If there are errors in the picture, please correct me.
Code Article
The preceding article has completed the operation of the two-fork lookup tree (BST).
You can use the BST tree directly, and the insert and delete operations will not change.
Only after inserting and deleting, to the root direction of backtracking, to find the first unbalanced node, divided into 8 kinds of conditions for different rotation can be.
Understandably, this unbalanced node must be near the leaf node, which is the case shown above.
Therefore, the AVL tree code is not a day or two can be written out, slowly will fill up the code.