public static ArrayList<ArrayList<Integer>> levelOrderButtom(TreeNode root) {
		// write your code here
		ArrayList<ArrayList<Integer>>rel=new ArrayList<>();
		Queue<TreeNode>q=new ArrayDeque<>();
		if (root!=null)
			q.offer(root);
		while (!q.isEmpty()) {
			ArrayList<Integer>list=new ArrayList<>();
			for (int i=0, n=q.size(); i<n;++i) {
				TreeNode c=q.poll();
				list.add(c.val);
				if (c.left!=null)
					q.offer(c.left);
				if (c.right!=null)
					q.offer(c.right);
			}
			rel.add(list);
		}
		Collections.reverse(rel);
		return rel;
	}