Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
youngyangyang04 committed Mar 23, 2022
1 parent 759175a commit 77aa72b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
3. [二叉树:听说递归能做的,栈也能做!](./problems/二叉树的迭代遍历.md)
4. [二叉树:前中后序迭代方式的写法就不能统一一下么?](./problems/二叉树的统一迭代法.md)
5. [二叉树:层序遍历登场!](./problems/0102.二叉树的层序遍历.md)
6. [二叉树:你真的会翻转二叉树么?](./problems/0226.翻转二叉树.md)
6. [二叉树:你真的会翻转二叉树么?](./problems/0226.翻转二叉树.md)
7. [本周小结!(二叉树)](./problems/周总结/20200927二叉树周末总结.md)
8. [二叉树:我对称么?](./problems/0101.对称二叉树.md)
9. [二叉树:看看这些树的最大深度](./problems/0104.二叉树的最大深度.md)
Expand Down
2 changes: 1 addition & 1 deletion problems/0028.实现strStr.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void getNext(int* next, const string& s)

1. 初始化:

定义两个指针i和j,j指向前缀起始位置,i指向后缀起始位置
定义两个指针i和j,j指向前缀末尾位置,i指向后缀末尾位置

然后还要对next数组进行初始化赋值,如下:

Expand Down
3 changes: 1 addition & 2 deletions problems/0494.目标和.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,10 @@ dp[j] 表示:填满j(包括j)这么大容积的包,有dp[j]种方法

有哪些来源可以推出dp[j]呢?

填满容量为j - nums[i]的背包,有dp[j - nums[i]]种方法。
不考虑nums[i]的情况下,填满容量为j - nums[i]的背包,有dp[j - nums[i]]种方法。

那么只要搞到nums[i]的话,凑成dp[j]就有dp[j - nums[i]] 种方法。


例如:dp[j],j 为5,

* 已经有一个1(nums[i]) 的话,有 dp[4]种方法 凑成 dp[5]
Expand Down

0 comments on commit 77aa72b

Please sign in to comment.