深度优先搜索+剪枝 * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @param root TreeNode类 * @param sum int整型 * @return bool布尔型 */ bool dfs(TreeNode* root,int target){ if(!root || target == 0) return false;//走到头了或者已经满足了和依然没有满足要求说明这条路径查...