Height and diameter show how to compute an answer from the answers of the children, which is the core skill for tree recursion. Height is needed to check if a tree is balanced. Diameter is the longest path between any two nodes, and it need not pass through the root. A common mistake is calling height inside every node separately, which is O(n²), when one postorder pass computes both in O(n).