Last updated 2 years ago
My Solution
class Solution { List<Integer> res = new ArrayList<>(); public List<Integer> postorder(Node root) { in(root); return res; } private void in(Node root){ if (root == null) return; for (Node n: root.children){ in(n); } res.add(root.val); } }