文件名称:tanlanbeibao
- 所属分类:
- 数学计算/工程计算
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2013-12-26
- 文件大小:
- 7kb
- 下载次数:
- 0次
- 提 供 者:
- 王*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
进的背包问题:给定一个超递增序列和一个背包的容量,然后在超递增序列中选(只能选一次)或不选每一个数值,使得选中的数值的和正好等于背包的容量。
代码思路:从最大的元素开始遍历超递增序列中的每个元素,若背包还有大于或等于当前元素值的空间,则放入,然后继续判断下一个元素;若背包剩余空间小于当前元素值,则判断下一个元素-Into the knapsack problem: Given a super-increasing sequence and a capacity backpack, and then in the super-increasing sequence selected (only choose one) or do not choose each value, and make the selected value is exactly equal to the capacity of the backpack. Code ideas: from the largest element traverses super increasing sequence for each element, if there is greater than or equal backpack space value of the current element, then placed, and then continue to determine the next element backpack space if the value is less than the current element , it is judged that an element
代码思路:从最大的元素开始遍历超递增序列中的每个元素,若背包还有大于或等于当前元素值的空间,则放入,然后继续判断下一个元素;若背包剩余空间小于当前元素值,则判断下一个元素-Into the knapsack problem: Given a super-increasing sequence and a capacity backpack, and then in the super-increasing sequence selected (only choose one) or do not choose each value, and make the selected value is exactly equal to the capacity of the backpack. Code ideas: from the largest element traverses super increasing sequence for each element, if there is greater than or equal backpack space value of the current element, then placed, and then continue to determine the next element backpack space if the value is less than the current element , it is judged that an element
(系统自动生成,下载前可以参看下载内容)
下载文件列表
新建文件夹\贪婪法背包2.cpp
..........\贪婪法背包2.dsp
..........\贪婪法背包2.dsw
..........\贪婪法背包2.ncb
..........\贪婪法背包2.opt
..........\贪婪法背包2.plg
新建文件夹