题解 | #二叉树的中序遍历#
二叉树的中序遍历
https://www.nowcoder.com/practice/0bf071c135e64ee2a027783b80bf781d
int pre_seq[1000] = {0}, i = 0; int* inorderTraversal(struct TreeNode* root, int* returnSize ) { if(root != NULL){ inorderTraversal(root->left, returnSize); pre_seq[i++] = root->val; inorderTraversal(root->right, returnSize); } *returnSize = i; return pre_seq; } //有点好奇递归过程当中也返回了pre_seq指针为啥不打印