我就乖乖递归了
vector<int> postorderTraversal(TreeNode* root) { // write code here static vector<int> res; if(!root)return res; postorderTraversal(root->left); postorderTraversal(root->right); res.push_back(root->val); return res; }
我就乖乖递归了
vector<int> postorderTraversal(TreeNode* root) { // write code here static vector<int> res; if(!root)return res; postorderTraversal(root->left); postorderTraversal(root->right); res.push_back(root->val); return res; }