5.5.1 Out of balance

An AVL tree is a complete tree, that means the heights of leaves are at the most one level off from each other. This is necessary because the only time all leaves have the same height is when the tree has 2n leaves for some integer n.

This means that a out-of-balance tree is one that has at least one leaf that is 2 more levels higher than other leaves.

We can assume that an AVL tree is always balanced before we add a node.