更新 背包理论基础 排版格式修复

This commit is contained in:
jinbudaily
2023-07-26 15:06:55 +08:00
parent 0e3500ed1c
commit 126aaac841
2 changed files with 19 additions and 17 deletions

View File

@@ -3,10 +3,13 @@
<img src="../pics/训练营.png" width="1000"/>
</a>
<p align="center"><strong><a href="https://mp.weixin.qq.com/s/tqCxrMEU-ajQumL1i8im9A">参与本项目</a>,贡献其他语言版本的代码,拥抱开源,让更多学习算法的小伙伴们收益!</strong></p>
# 动态规划01背包理论基础滚动数组
**《代码随想录》算法视频公开课:[带你学透0-1背包问题滚动数组](https://www.bilibili.com/video/BV1BU4y177kY/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 算法公开课
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html)[带你学透0-1背包问题滚动数组](https://www.bilibili.com/video/BV1BU4y177kY/),相信结合视频再看本篇题解,更有助于大家对本题的理解**。
## 思路
昨天[动态规划关于01背包问题你该了解这些](https://programmercarl.com/背包理论基础01背包-1.html)中是用二维dp数组来讲解01背包。
@@ -29,7 +32,7 @@
问背包能背的物品最大价值是多少?
## 一维dp数组滚动数组
### 一维dp数组滚动数组
对于背包问题其实状态都是可以压缩的。
@@ -154,8 +157,6 @@ dp[1] = dp[1 - weight[0]] + value[0] = 15
## 一维dp01背包完整C++测试代码
```CPP
void test_1_wei_bag_problem() {
vector<int> weight = {1, 3, 4};
@@ -318,7 +319,7 @@ func main() {
}
```
### javaScript
### JavaScript
```js
@@ -459,3 +460,4 @@ fn test_wei_bag_problem2() {
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>