Go | Iterative solution
Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\ngolang []\n/**\n * Definition for a Node.\n * type Node struct {\n *     Val int\n * 
# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```golang []\n/**\n * Definition for a Node.\n * type Node struct {\n *     Val int\n *     Children []*Node\n * }\n */\n\nfunc postorder(root *Node) []int {\n    if root == nil { return []int{} }\n    \n    stack := []*Node{root}\n    ans := []int{}\n    for len(stack) > 0 {\n        size := len(stack)\n        currentNode := stack[size-1]\n        stack = stack[:size-1]\n        ans = append(ans, currentNode.Val)\n        for _, node := range currentNode.Children {\n            stack = append(stack, node)\n        }\n    }\n    slices.Reverse(ans)\n    return ans\n}\n\n```
['Iterator', 'Go']