5.7 Deletion for an AVL tree

Deleting a node in an AVL tree is slightly different. This is because an AVL tree guarantees that the maximum link difference between any leaf and the root is 1. This means that, in the worst case, the node to replace the node being deleted is at the most one above a leaf.

As a result, there are only a few cases to handle. Let us consider the deletion of node n, and the tree rooted at n is as (TL,n,TR).