File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 371371
372372``` c
373373// 前序遍历:
374- void preOrderTraversal (struct TreeNode* root, int* ret, int* returnSize) {
374+ void preOrder (struct TreeNode* root, int* ret, int* returnSize) {
375375 if(root == NULL)
376376 return;
377377 ret[ (* returnSize)++] = root->val;
378- preOrderTraverse (root->left, ret, returnSize);
379- preOrderTraverse (root->right, ret, returnSize);
378+ preOrder (root->left, ret, returnSize);
379+ preOrder (root->right, ret, returnSize);
380380}
381381
382382int* preorderTraversal(struct TreeNode* root, int* returnSize){
383383 int* ret = (int* )malloc(sizeof(int) * 100);
384384 * returnSize = 0;
385- preOrderTraversal (root, ret, returnSize);
385+ preOrder (root, ret, returnSize);
386386 return ret;
387387}
388388
You can’t perform that action at this time.
0 commit comments