登录
首页 » 算法 » 0/1背包java实现

0/1背包java实现

于 2022-04-13 发布 文件大小:1.46 kB
0 177
下载积分: 2 下载次数: 1

代码说明:

import java.util.Scanner; public class Packsack{ Scanner sc=new Scanner(System.in); int n;//物品个数 int m;//背包最大容量 int w[];//存储每个物品的重量 int v[];//存储每个物品的价值 int Max[][];//行表示前i个物品,列表示容量j,该值为将前i个物品装入容量为j的最大价值 public Packsack(){ System.out.println("please input the number of goods"); n=sc.nextInt

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 对偶单纯形
    求解线性规划的对偶单纯形法,c语言版。线性规划的对偶单纯形法用c语言实现
    2023-01-05 11:05:03下载
    积分:1
  • poj3352给一个图,求出需要加最少的边使去掉任一条边,图都连通.割点的应用...
    poj3352给一个图,求出需要加最少的边使去掉任一条边,图都连通.割点的应用-poj3352 to a map, obtained at least the need to remove the edges so that any one side, map are connected. cut-point application
    2023-07-27 11:35:03下载
    积分:1
  • 一个程序来寻找频繁项集(关闭和最大)与Eclat
    A program to find frequent itemsets (also closed and maximal) with the eclat algorithm ,which carries out a depth first search on the subset lattice and determines the support of itemsets by intersecting transaction lists. -A program to find frequent itemsets (also c losed and maximal) with the eclat algorithm, which carries out a depth first search on the sub set lattice and determines the support of items ets by intersecting transaction lists.
    2022-02-20 07:32:43下载
    积分:1
  • 数据挖掘中的bridgit的例子。 非常经典
    数据挖掘中的bridgit算法的例子。 非常经典-of data mining algorithms bridgit example. Very classic
    2022-07-07 13:17:01下载
    积分:1
  • Unix下的复数运,实现了复数的加减、开方运
    Unix下的复数运算,实现了复数的加减、开方运算-Unix complex operation, realized the plural number addition and subtraction, the root has operated
    2022-03-03 10:31:13下载
    积分:1
  • c++编写的音乐播放器
    用c++而且也用到MFC 对播放器进行了编写 有图形界面用c++而且也用到MFC 对播放器进行了编写 有图形界面用c++而且也用到MFC 对播放器进行了编写 有图形界面用c++而且也用到MFC 对播放器进行了编写 有图形界面用c++而且也用到MFC 对播放器进行了编写 有图形界面用c++而且也用到MFC 对播放器进行了编写 有图形界面
    2022-09-25 18:20:03下载
    积分:1
  • sdfvasdfvasvda
    2022-06-16 18:34:51下载
    积分:1
  • MarchingCubes的VTK实现(适合初学者)
    MarhingCubes算法由二维断层图像序列构成的三维数据提供,在上下相邻的两层图像上取相邻的4 个点构成一个立方体体元。对体数据中的所有体元进行逐个遍历,对于每个被处理的体元,通过与给定的阈值进行对比确定等值点的位置,再通过线性插值的方法计算等值点坐标和法向量,最后以三角面片的方式连接成等值面显示。VTK移动立方体
    2022-03-16 05:19:38下载
    积分:1
  • havel定理
    这是一个学生管理的简单代码,它是基于MFC的对话框,在这里面,使用了MFC的数据库类CDatabase和CRecordset这两个封装好了的类,同时他实现了基本的学生管理功能,可以用来学习或者练手
    2022-06-26 03:04:30下载
    积分:1
  • 实现一个超过了计机所表示范围的长整数的加减
    实现一个超过了计算机所表示范围的长整数的加减法-achieve an over by the computer, said the scope of the long integer addition and subtraction
    2023-04-11 17:05:03下载
    积分:1
  • 696518资源总数
  • 105873会员总数
  • 12今日下载