/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * }; */ class Solution { public: // 回溯算法 // 返回x的搜索路径 void GetParentTrack(TreeNode* root, int x, vector<int>& track) { ...