public static List<Integer> postorderTraversal(TreeNode root) {
		List<TreeNode> stack = new ArrayList<TreeNode>();
		List<Integer> res = new ArrayList<Integer>();
		Map<TreeNode, Boolean> isFirstTraversal = new HashMap<TreeNode, Boolean>();
		TreeNode node = root;
		while (null != node || 0 != stack.size()) {
			while (null != node) {
				stack.add(node);
				isFirstTraversal.put(node, Boolean.TRUE);
				node = node.left;
			}
			if (0 != stack.size()) {
				int size = stack.size();
				TreeNode cn = stack.remove(size - 1);
				if (isFirstTraversal.get(cn) == Boolean.TRUE) {
					isFirstTraversal.put(cn, Boolean.FALSE);
					stack.add(cn);
					node = cn.right;
				} else {
					res.add(cn.val);
					node = null;
				}
			}
		}
		return res;
	}