JavaScript Iterative & Recursive
Iteravtive Post-order Traverse\n- Time Complexity: O(N)\n- Space Complexity: O(N)\nJavaScript\n/**\n * @param {Node} root\n * @return {number[]}\n */\nvar posto
### Iteravtive Post-order Traverse\n- Time Complexity: **O(N)**\n- Space Complexity: **O(N)**\n```JavaScript\n/**\n * @param {Node} root\n * @return {number[]}\n */\nvar postorder = function(root) {\n    const res = [], stack = [root];\n    while (stack.length) {\n        const curr = stack.pop();\n        if (!curr) continue;\n        res.push(curr.val);\n        stack.push(...curr.children);\n    }\n    return res.reverse();\n};\n```\n### Recursive Post-order Traverse\n- Time Complexity: **O(N)**\n- Space Complexity:\n    - **O(log N)** in average case.\n    - **O(N)** in worst case, that there is an unbalanced tree.\n```JavaScript\n/**\n * @param {Node} root\n * @return {number[]}\n */\nvar postorder = function(root) {\n    const res = [];\n    traverse(root);\n    return res;\n    \n    function traverse(node) {\n        if (!node) return;\n        for(child of node.children) {\n            traverse(child);\n        }\n        res.push(node.val);\n    } \n};\n```
['Recursion', 'Iterator', 'JavaScript']