二叉树的遍历:三种递归遍历: //前序遍历 void preorder(TreeNode *root, vector<int> &path) { if(root != NULL) { path.push_back(root->val); preorder(root->left, path); preorder(root->right, path); } } //中序遍历 void inorder(TreeNode *root, vector<int> &path) ...