public static List<Integer> postorderTraversal(TreeNode root) {
		List<Integer> rel=new ArrayList<>();
		TreeNode p=null, c=root;
		Queue<TreeNode>s=Collections.asLifoQueue(new ArrayDeque<>());
		while (c!=null||!s.isEmpty()) {
			if (c!=null) {
				s.offer(c);
				c=c.left;
			}
			if (c==null) {
				TreeNode t=s.peek();
				if (t.right==null||t.right==p) {
					p=t;
					rel.add(s.poll().val);
				} else {
					c=t.right;
				}
			}
		}
		return rel;
	}