文件名称:tanlanbeibao
-
所属分类:
- 标签属性:
- 上传时间:2013-12-26
-
文件大小:6.9kb
-
已下载: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
新建文件夹/
新建文件夹/贪婪法背包2.dsp
新建文件夹/贪婪法背包2.dsw
新建文件夹/贪婪法背包2.ncb
新建文件夹/贪婪法背包2.opt
新建文件夹/贪婪法背包2.plg
新建文件夹/
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.