From 7d822fe65a587f883a5d63c1b72c139239f2cff7 Mon Sep 17 00:00:00 2001 From: El nino <69737612+el-nino2020@users.noreply.github.com> Date: Sat, 14 Jan 2023 09:18:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Update=2020201003=E4=BA=8C=E5=8F=89?= =?UTF-8?q?=E6=A0=91=E5=91=A8=E6=9C=AB=E6=80=BB=E7=BB=93.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typo? --- problems/周总结/20201003二叉树周末总结.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/周总结/20201003二叉树周末总结.md b/problems/周总结/20201003二叉树周末总结.md index 18bbf37f..5f59b040 100644 --- a/problems/周总结/20201003二叉树周末总结.md +++ b/problems/周总结/20201003二叉树周末总结.md @@ -2,7 +2,7 @@ 本周赶上了十一国庆,估计大家已经对本周末没什么概念了,但是我们该做总结还是要做总结的。 -本周的主题其实是**简单但并不简单**,本周所选的题目大多是看一下就会的题目,但是大家看完本周的文章估计也发现了,二叉树的简答题目其实里面都藏了很多细节。 这些细节我都给大家展现了出来。 +本周的主题其实是**简单但并不简单**,本周所选的题目大多是看一下就会的题目,但是大家看完本周的文章估计也发现了,二叉树的简单题目其实里面都藏了很多细节。 这些细节我都给大家展现了出来。 ## 周一 From c201b947a5bb4510b5c0214ec652c6300a2c6760 Mon Sep 17 00:00:00 2001 From: El nino <69737612+el-nino2020@users.noreply.github.com> Date: Sat, 14 Jan 2023 15:06:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Update=200112.=E8=B7=AF=E5=BE=84=E6=80=BB?= =?UTF-8?q?=E5=92=8C.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原有的代码leetcode上无法通过编译 --- problems/0112.路径总和.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/0112.路径总和.md b/problems/0112.路径总和.md index 7aa5f2a1..b1f01336 100644 --- a/problems/0112.路径总和.md +++ b/problems/0112.路径总和.md @@ -155,14 +155,14 @@ public: 以上代码精简之后如下: ```cpp -class solution { +class Solution { public: bool hasPathSum(TreeNode* root, int sum) { - if (root == null) return false; + if (!root) return false; if (!root->left && !root->right && sum == root->val) { return true; } - return haspathsum(root->left, sum - root->val) || haspathsum(root->right, sum - root->val); + return hasPathSum(root->left, sum - root->val) || hasPathSum(root->right, sum - root->val); } }; ```