= the length of the longest path starting at and going down into 's subtree. For a leaf, (no edges going down).
For internal nodes, over all children. At each node , the longest path through combines the two deepest downward paths: . Track this in a global variable as you go.