```
class Solution(object):
def postorderTraversal(self, root):
if root == None:
return []
s1 = []
s2 = []
s1.append(root)
while s1:
node = s1.pop()
s2.insert(0, node.val)
if node.left:
s1.append(node.left)
if node.right:
s1.append(node.right)
return s2
```