Say you have a binary tree which looks like this
A
/ \
B C
/ \ / \
D E F G
/ /
H I
Assume A is level 1. So here you can see that the width at level 3 = 4, which is the max width of the tree. So given a binary tree, find the max width of the tree.This is your function:
public int findWidth(Node root)
and public Node{
String val;
Node getLeft();
Node getRight();
}