标签:int leetcode ack oid efi code roo rsa turn
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int>fc;
void dfs(TreeNode* fe){
if(fe==NULL)return ;
dfs(fe->left);
dfs(fe->right);
fc.push_back(fe->val);
}
vector<int> postorderTraversal(TreeNode* root) {
dfs(root);
return fc;
}
};
LeetCode - Binary Tree Postorder Traversal
标签:int leetcode ack oid efi code roo rsa turn
原文地址:http://www.cnblogs.com/clover-xuqi/p/7154880.html