Given a binary tree, compute the diameter of the tree.
The diameter is the longest path between any two nodes in the tree.
This problem asks for the diameter of a binary tree, defined as the longest path between any two nodes. The standard solution uses DFS to compute the height of each subtree, while updating a global maximum with left height + right height at every node. This yields an O(n) time solution with O(h) recursion stack space.