标签:private oid 技术分享 blog nod order http vector nbsp
代码:
public:
vector<int> inorderTraversal(TreeNode* root) {
vector<int> ret;
if(root==NULL)return ret;
inorderHelper(ret,root);
return ret;
}
private:
void inorderHelper(vector<int>& ret,TreeNode* root)
{
if(root==NULL)return;
inorderHelper(ret,root->left);
ret.push_back(root->val);
inorderHelper(ret,root->right);
} ;
lintcode截图:
标签:private oid 技术分享 blog nod order http vector nbsp
原文地址:http://www.cnblogs.com/aly15109725486/p/7235756.html