knapsack.h

来自「0/1背包问题的几种解法」· C头文件 代码 · 共 26 行

H
26
字号
#define MAXSIZE 26
#define CAPACITY 500

typedef struct{
	int Weight[MAXSIZE+1];
	int Value[MAXSIZE+1];
	int Capacity;
}KNAPSACK;

typedef struct{
	int weight;
	int value;
}ITEM;

static int BestValue=0;
static int Xi[MAXSIZE+1];
static int CurrentXi[MAXSIZE+1];
static int CurrentWeight=0;
static int CurrentValue=0;
static KNAPSACK knapsack;

void KnapsackByExhaustion(int);
void InitKnapsack();
void PrintKnapsackInfo();
void PrintSelect();
void PrintTitle(char *);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?