Diameter of Binary Tree
Problem
Input: root = [1,2,3,4,5] Output: 3 Explanation: 3 is the length of the path [4,2,1,3] or [5,2,1,3].Input: root = [1,2] Output: 1
Pseudocode
Solution
Time and Space Complexity
Time
Space
Last updated
