Lesson 1 Flashcards
Named after their inventor_, _are height balancing binary search tree. _ checks the height of the left and the right sub-trees and assures that the difference is not more than 1. This difference is called the Balance Factor.
Adelson- Velski & Landis
AVL trees
AVL Rotations
To balance itself, an AVL tree may perform the following four kinds of rotations −
- Left rotation
- Right rotation
- Left-Right rotation
- Right-Left rotation
If a tree becomes unbalanced, when a node is inserted into the right subtree of the right subtree.
LEFT ROTATION
AVL tree may become unbalanced, if a node is inserted in the left subtree of the left subtree.
RIGHT ROTATION
Double rotations are slightly complex version of already explained versions of rotations. To understand them better, we should take note of each action performed while rotation.
LEFT-RIGHT ROTATION
The second type of double rotation is _ Rotation. It is a combination of right rotation followed by left rotation.
RIGHT-LEFT ROTATION