public int maxDepth(TreeNode root) {
		// Note: The Solution object is instantiated only once and is reused by each test case.
		// bfs
		if(root == null) return 0;
		Queue<TreeNode> q = new LinkedList<TreeNode>();
		int depth=0;
		q.add(root);
		q.add(null);
		TreeNode currentNode;
		while(q.isEmpty()==false){
			currentNode=q.poll();
			if(currentNode==null) {
				depth++;
				if(q.isEmpty()==true) return depth;
				else q.add(null);
			}else{
				if(currentNode.left!=null) q.add(currentNode.left);
				if(currentNode.right!=null) q.add(currentNode.right);
			}
		}
		return depth;
	}