Subtopic 7.3
AVL Tree
6lessons41 min0done
An AVL tree is a binary search tree that keeps the height difference of the two subtrees at most 1 at every node. When the difference reaches 2, a small link change called a rotation brings the balance back without breaking the order.
The subtopic first explains the balance factor, then the two single rotations and the two double rotations. The last two lessons use them in insertion and deletion: the value is placed, and on the way back up every node is updated and rotated if needed.