```
def postorderTraversal(self, root):
if not root: return []
stack = [root]
res = []
while stack:
cur = stack.pop()
if cur.left: stack.append(cur.left)
if cur.right: stack.append(cur.right)
res.append(cur.val)
return res[::-1]
```