Skip to content

Commit fb18039

Browse files
committed
Update 01.Knapsack-Problem-01.md
1 parent e5d97ff commit fb18039

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Contents/10.Dynamic-Programming/04.Knapsack-Problem/01.Knapsack-Problem-01.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
> **背包问题**:背包问题是线性 DP 问题中一类经典而又特殊的模型。背包问题可以描述为:给定一组物品,每种物品都有自己的重量、价格以及数量。再给定一个最多能装重量为 $W$ 的背包。现在选择将一些物品放入背包中,请问在总重量不超过背包载重上限的情况下,能装入背包的最大价值总和是多少?
66
7-
![](https://qcdn.itcharge.cn/images/202303191755045.png)
7+
![背包问题](https://qcdn.itcharge.cn/images/20240514111553.png)
88

99
根据物品限制条件的不同,背包问题可分为:0-1 背包问题、完全背包问题、多重背包问题、分组背包问题,以及混合背包问题等。
1010

@@ -20,7 +20,7 @@
2020

2121
> **0-1 背包问题**:有 $n$ 件物品和有一个最多能装重量为 $W$ 的背包。第 $i$ 件物品的重量为 $weight[i]$,价值为 $value[i]$,每件物品有且只有 $1$ 件。请问在总重量不超过背包载重上限的情况下,能装入背包的最大价值是多少?
2222
23-
![](https://qcdn.itcharge.cn/images/202303191759967.png)
23+
![0-1 背包问题](https://qcdn.itcharge.cn/images/20240514111617.png)
2424

2525
### 2.1 0-1 背包问题基本思路
2626

0 commit comments

Comments
 (0)