Maximum width of binary tree - PrismoSkills
Solution 1: We can traverse the tree in level order fashion using a queue, inserting a dummy node when one level is completed. Then we know exactly when a level begins and when it ends and we can find maximum width.
Solution 2: Allocate an array of length tree-height to store node-counts at every level.
While traversing (in any traversal), increment the widths[level] at every node in the tree.
Then find the maximum in this array
Read full article from Maximum width of binary tree - PrismoSkills