balance factor

For a tree node, the height of its left subtree minus the height of its right subtree.

In more detail

An AVL tree requires every node's balance factor to be -1, 0 or +1. A value of +2 or -2 after an insert means that node is out of balance and a rotation is needed. Nodes store their heights so balance factors can be computed in O(1).

Related terms

Taught in

References