':type root: TreeNode
:rtype: List[int]'

def postorderTraversal(self, root):

    dummy = TreeNode(0)
    dummy.left = root
    (result, cur) = ([], dummy)
    while cur:
        if (cur.left is None):
            cur = cur.right
        else:
            node = cur.left
            while (node.right and (node.right != cur)):
                node = node.right
            if (node.right is None):
                node.right = cur
                cur = cur.left
            else:
                result += self.traceBack(cur.left, node)
                node.right = None
                cur = cur.right
    return result
