Java Iterative and Recursive Solutions
Iterative\n\nclass Solution {\n    public List<Integer> postorder(Node root) {\n        List<Integer> list = new ArrayList<>();\n        if (root == null) retur
Iterative\n```\nclass Solution {\n    public List<Integer> postorder(Node root) {\n        List<Integer> list = new ArrayList<>();\n        if (root == null) return list;\n        \n        Stack<Node> stack = new Stack<>();\n        stack.add(root);\n        \n        while(!stack.isEmpty()) {\n            root = stack.pop();\n            list.add(root.val);\n            for(Node node: root.children)\n                stack.add(node);\n        }\n        Collections.reverse(list);\n        return list;\n    }\n}\n```\nRecursive\n```\nclass Solution {\n    List<Integer> list = new ArrayList<>();\n    public List<Integer> postorder(Node root) {\n        if (root == null)\n            return list;\n        \n        for(Node node: root.children)\n            postorder(node);\n        \n        list.add(root.val);\n        \n        return list;\n    }\n}\n```
[]