Tree: Depth-First Search - Diameter of Binary Tree
Consider the following iterative postorder traversal code to compute the diameter of a binary tree. Given the tree:
1
/ \
2 3
/
4
What is the final value of the variable
diameter after the function completes?