543. Diameter of Binary Tree
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root.
GeeksforGeeks
ProgramCreek
Input: [1, 2, 3, 4, 5, null, null, 6, null, null, null, 7]
Output: 5