C++ iterative 100% | 100%
\nclass Solution {\npublic:\n    vector<int> postorder(Node* root) {\n        if(!root)\n            return {};\n        vector<int> ans;\n        stack<pair<No
```\nclass Solution {\npublic:\n    vector<int> postorder(Node* root) {\n        if(!root)\n            return {};\n        vector<int> ans;\n        stack<pair<Node*,bool>> st;\n        st.push({root,false});\n        while(!st.empty()){\n            auto curr=st.top();\n            st.pop();\n            root=curr.first;bool flag=curr.second;\n            if(!flag){\n                st.push({root,true});\n                for(auto it=root->children.rbegin();it!=root->children.rend();++it)\n                    st.push({*it,false});\n            }\n            else\n                ans.push_back(root->val);\n        }\n        return ans;\n    }\n};\n```
[]