int getMaxWidth(TreeNode<int> *root)
{
if(root==NULL) return 0;
queue<TreeNode<int>*>q;
int res=INT_MIN;
q.push(root);
while(q.empty()==false)
{
int ct=q.size();
res=max(res,ct);
for(int i=0;i<ct;i++)
{
TreeNode<int>*curr=q.front();
q.pop();
if(curr->left !=NULL)
q.push(curr->left);
if(curr->right !=NULL)
q.push(curr->right);
}
}
return res;
}



