public  int maxDepth(TreeNode root){
        if(root == null) return 0;
        LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
		queue.offer(root);
		queue.offer(null);

		int dep = 0;
		while(!queue.isEmpty()){
			TreeNode n = queue.poll();
			if(n == null) {
				++dep;
				if(queue.isEmpty()) break;
				queue.offer(n);
			}else {
                if(n.left != null) queue.offer(n.left);
                if(n.right != null) queue.offer(n.right);
            }
		}
		return dep;
    }