中序遍历,将每个结点放到数组中,然后遍历数组中的元素 /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: vector<TreeNode*> vi; void dfs(TreeNode* node) { if (node) { dfs(node ...