Concept Flow - Diameter of Binary Tree
Start at root node
Calculate left subtree height
Calculate right subtree height
Calculate diameter through current node = left height + right height
Update max diameter if current diameter is larger
Return height of current node = max(left height, right height) + 1
Repeat for left and right child nodes recursively
End when all nodes visited
Final max diameter is result
We start at the root and recursively find the height of left and right subtrees. At each node, we calculate the diameter passing through it and update the maximum diameter found. We return the height to parent nodes to continue the process.