C++ Easy Solution Iterative Postorder
\n#define s second\n#define f first\n#define null nullptr\nclass Solution {\npublic:\n    // Recursion \n    // vector <int> ans ;\n    // void postorder_helper
```\n#define s second\n#define f first\n#define null nullptr\nclass Solution {\npublic:\n    // Recursion \n    // vector <int> ans ;\n    // void postorder_helper(Node* root) {\n    //     if(root==null) return;\n    //     for(int i =0 ; i< root->children.size();i++){\n    //         if(root->children[i]!=null){\n    //             postorder(root->children[i]);\n    //         }\n    //     }\n    //     ans.push_back(root->val);\n    // }\n\t// Iterative\n    vector<int> postorder(Node* root) {\n        if(root==null) return {};\n        vector <int> ans ;\n        Node* temp = root ;\n        stack <pair<Node*,int>> st ;\n        st.push({temp,0});\n        while(!st.empty()){\n            if(st.top().s+1 > st.top().f->children.size()){\n                temp=null;\n            }else{\n                temp = st.top().f->children[st.top().s];\n            }\n            if(temp ==null){\n                temp = st.top().f;\n                st.pop();\n                ans.push_back(temp->val);\n                if(st.empty()) break ;\n                st.top().s++;\n            }else{\n                st.push({temp,0});\n            }\n        }\n        return ans;\n    }\n};\n```
['Stack', 'C', 'Iterator', 'C++']