Intro to Algorithms
The balance factor is a critical measure used in self-balancing binary search trees to maintain the tree's balanced structure. It is calculated as the difference between the heights of the left and right subtrees of a node, typically expressed as \( \text{balance factor} = \text{height(left subtree)} - \text{height(right subtree)} \). A balance factor of -1, 0, or 1 indicates that the tree is balanced at that node, which is essential for ensuring efficient operations like insertions, deletions, and lookups.
congrats on reading the definition of Balance Factor. now let's actually learn it.