Python iterative method, easy to read.
py\nclass Solution:\n    def postorder(self, root: \'Node\') -> List[int]:\n        if not root:\n            return []\n\n        res = []\n        stack = [ro
```py\nclass Solution:\n    def postorder(self, root: \'Node\') -> List[int]:\n        if not root:\n            return []\n\n        res = []\n        stack = [root, root]\n\n        while stack:\n            cur = stack.pop()\n            if stack and cur == stack[-1]:\n                for i in reversed(cur.children):\n                    stack.append(i)\n                    stack.append(i)\n            else:\n                res.append(cur.val)      \n            \n        return res\n\n```\n1. ![image](https://assets.leetcode.com/users/images/738d6a4c-7f41-401d-89f3-72c8de45d7da_1601985591.525488.png)\n2. ![image](https://assets.leetcode.com/users/images/176b9cfe-7d03-45fc-9c77-17aa93c700f0_1601985615.2362242.png)\n3. ![image](https://assets.leetcode.com/users/images/2674c4db-9d4c-4bcc-a7fa-bf3022356c46_1601985628.9963758.png)\n4. ![image](https://assets.leetcode.com/users/images/bbfd23be-284d-47bb-bad0-16f75f0297ad_1601985646.9614966.png)\n5. res = [5]\n6. ![image](https://assets.leetcode.com/users/images/c4d8a942-18ea-44c7-82fc-832cc3a6fb39_1601985667.310323.png)\n7. ![image](https://assets.leetcode.com/users/images/d71687fb-7c5e-4b4c-be85-a9596d4a962c_1601985682.1152947.png)\n8. res = [5, 6]\n9. ![image](https://assets.leetcode.com/users/images/c01a1992-3550-4c51-85be-8228ffcb8559_1601985704.138507.png)\n10. res = [5, 6, 3]\n11. ![image](https://assets.leetcode.com/users/images/6670c65c-8a65-46c9-98ab-64766376cc8c_1601985722.4816813.png)\n12. res = [5, 6, 3, 2]\n13. ![image](https://assets.leetcode.com/users/images/b00e8a94-6e9a-46a2-9e04-6a4fcf04a04c_1601985798.514335.png)\n14. ![image](https://assets.leetcode.com/users/images/0b53250d-6bf9-45ba-ab11-750e9b15f0cc_1601985751.474457.png)\n15. ![image](https://assets.leetcode.com/users/images/682ed46a-b283-4107-ace3-8edd09361101_1601985811.6532793.png)\n16. res = [5, 6, 3, 2, 4]\n17. ![image](https://assets.leetcode.com/users/images/217d3d51-e8e3-4da9-9a31-61877ee06b20_1601985830.3264427.png)\n18. res = [5, 6, 3, 2, 4, 1]\n\n\n\n\n\n
[]