While updating the heights of my subtrees in an AVL rotation implementation, I noticed in the example the code that the height function is
x->height = max(height(x->left), height(x->right)) +1;
Does anyone know where the +1 comes from and why?
Thanks!