Diameter of a binary tree
Return the number of edges on the longest path between any two nodes of a binary tree. The path need not pass through the root. Solve it in one pass.
No answer yet. Write the first one; the best answer gets endorsed.
Return the number of edges on the longest path between any two nodes of a binary tree. The path need not pass through the root. Solve it in one pass.