public int maxDepth(TreeNode root) {
		// Start typing your Java solution below
		// DO NOT write main() function
		if (root == null)
			return 0;
		Queue<TreeNode> q = new LinkedList<TreeNode>();
		q.offer(root);
		int depth = 0;
		while (!q.isEmpty()) {
			int n = q.size();
			while ((n--) > 0) {
				TreeNode tmpNode = q.poll();
				if (tmpNode.left != null)
					q.offer(tmpNode.left);
				if (tmpNode.right != null)
					q.offer(tmpNode.right);
			}
			depth++;
		}
		return depth;
	}