Maximum Width Of Binary Tree
Try First, Check Solution later1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.
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
Asked in Companies