动态规划:0-1背包问题
发布时间
阅读量:
阅读量
目录
- 01背包问题简介
- 详细说明
- 状态转移方程详解
- 举例
- 代码块
- 测试结果
01背包问题简介
The 0-1 knapsack problem is defined as follows: Given n items and a knapsack. Each item i has a weight wi and a value vi, and the knapsack has a capacity C. The question asks how to select items to be placed in the knapsack such that the total value of selected items is maximized. For each item i, there are only two choices: either include it in the knapsack or exclude it. Additionally, it is not allowed to place multiple copies of an item into the knapsack or take only a portion of an item. Therefor
全部评论 (0)
还没有任何评论哟~
