import java.util.*;
public class Main {
/**
//该段代码仅用于调试,提交时请注释该段代码
class TreeNode<T> {
public T data;
public TreeNode<T> left;
public TreeNode<T> right;
}
*/
public int solution(TreeNode<Integer> root) {
if(root ==null){
return 0;
}
Queue<TreeNode<Integer>> q = new LinkedList<>();
TreeNode<Integer>p=root;
q.add(p);
int max = 0x80000000;
while (q.isEmpty() == false)
{
List<Integer> list = new ArrayList<>();
int sz = q.size();
if(max < sz){
max = sz;
}
while(sz != 0){
p = q.poll();
if(p.left != null){
q.add(p.left);
}
if(p.right != null){
q.add(p.right);
}
sz--;
}
}
return max;
}
}