leetcode 112:路径总和

感觉二叉树用递归基本都能做出来,这个也比较简单 bool hasPathSum(TreeNode* root,int sum){ if(root==NULL) return false; TreeNode*l=root->left; TreeNode*r=root->right; if(l==NULL&&r==NULL&&root->val==sum
相关文章
相关标签/搜索