动态规划求0_1背包问题

文章作者 100test 发表时间 2011:03:18 20:32:07
来源 100Test.Com百考试题网


  #include
  #include
  #include
  //goods是一个或多个物品的重量和价值
  typedef struct goods
  {
  int weight.
  int value.
  } goods.
  //用来定义一个queryList数组
  //数组中的每个元素定义一趟需要记录的数据
  typedef struct queryList
  {
  goods *subResult. //一趟需要记录的数据
  int end. //指示该趟数据的最后一个元素
  } queryList.
  queryList* dknap(goods *Goods, int count, int capacity)
  {
  int i, j, next, pre, index, k.
  queryList *ql.
  goods cur.
  ql = (queryList *)malloc(sizeof(queryList)*count).
  ql[0].subResult = (goods*)malloc(sizeof(goods)).
  ql[0].end = 0.
  ql[0].subResult-


相关文章


计算机二级辅导:VisualC 链接器选项
C Builder定制系统菜单
你应当如何学习C (以及编程)
Windows中的消息截获
动态规划求0_1背包问题
用动态规划实现导弹拦截
贪心算法
RPC远程过程调用实例详解
全国计算机等级二级VB分章节考试要点汇总
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛