Fix a definition.

This commit is contained in:
krahets
2023-08-27 00:50:18 +08:00
parent debf42b189
commit 9731a46d67
85 changed files with 167 additions and 159 deletions
@@ -34,7 +34,7 @@ func TestKnapsack(t *testing.T) {
res = knapsackDP(wgt, val, c)
fmt.Printf("不超过背包容量的最大物品价值为 %d\n", res)
// 状态压缩后的动态规划
// 空间优化后的动态规划
res = knapsackDPComp(wgt, val, c)
fmt.Printf("不超过背包容量的最大物品价值为 %d\n", res)
}
@@ -48,7 +48,7 @@ func TestUnboundedKnapsack(t *testing.T) {
res := unboundedKnapsackDP(wgt, val, c)
fmt.Printf("不超过背包容量的最大物品价值为 %d\n", res)
// 状态压缩后的动态规划
// 空间优化后的动态规划
res = unboundedKnapsackDPComp(wgt, val, c)
fmt.Printf("不超过背包容量的最大物品价值为 %d\n", res)
}