Python solution
Recursive:\n\nclass Solution(object):\n    def postorder(self, root):\n        """\n        :type root: Node\n        :rtype: List[int]\n        """\n        de
Recursive:\n```\nclass Solution(object):\n    def postorder(self, root):\n        """\n        :type root: Node\n        :rtype: List[int]\n        """\n        def dfs(root):\n            if not root:\n                return\n            for c in root.children:\n                dfs(c)\n            res.append(root.val)\n        res = []\n        dfs(root)\n        return res\n```\n\nIterative:\n```\nclass Solution(object):\n    def postorder(self, root):\n        """\n        :type root: Node\n        :rtype: List[int]\n        """\n        if not root:\n            return []\n        res = collections.deque()\n        stack = [root]\n        while stack:\n            u = stack.pop()\n            res.appendleft(u.val)\n            for c in u.children:\n                stack.append(c)\n        return list(res)\n```
[]