Maximum Width Of Binary Tree
1. Given the root of a binary tree, return the maximum width of the given tree.Input Format
2. The maximum width of a tree is the maximum width among all levels.
3. The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes are also counted into the length calculation.
Input is managed for you.Output Format
Output is managed for you.Question Video
0 <= Number of Nodes <= 10^5Sample Input
-1000 <= value of Node data <= 1000
1 3 5 null null 3 null null 2 null 9 null nullSample Output
4
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run