Java开发岗,第一题怎么回事,string搞不好,总是编译错误,哪里有错啊,求大佬解读 string notReCuPreOrder(TreeNode* root) { // write code here string str; TreeNode *stack[10010]; int top = -1; TreeNode *temp; stack[++top]=root; while(top!=-1){ temp = stack[top--]; str = str + temp->val; //总报这行有错 if(root->right!=NULL){ stack[++top]=root->right; } if(root->left!=NULL){ stack[++top]=root->left; } } return str; }
点赞 3

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务