Maximum Width of Binary Tree
Example
Input:
1
/ \
3 2
/ \ \
5 3 9
Output:
4
Explanation:
The maximum width existing in the third level with the length 4 (5,3,null,9).Input:
1
/
3
/ \
5 3
Output:
2
Explanation:
The maximum width existing in the third level with the length 2 (5,3).Note
Code
Last updated