⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 decconquer.h

📁 算法实验:1 分治法在数值问题中的应用 ——最近点对问题 2 减治法在组合问题中的应用——8枚硬币问题 3 变治法在排序问题中的应用——堆排序 4 动态规划法在图问题中的应用——全源最短路径问题
💻 H
字号:
#ifndef DECCONPUER_H
#define	DECCONPUER_H

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <time.h>
#include <limits.h>
#include <math.h>

#define MAX_COIN 100	//the max of coin quantity

typedef struct{
	int weigth;	//the weight of every coin
	int index;
}Coin,*Coins;

//Comparing the weight of two piles of coins 
//Input:	Two piles of coins A and B
// return 0 if the piles weith the same,
//-1 if A is lighter the B, 1 if A is not lighter than B
int Compare(Coin A[],Coin [],int len);

//Detecting the fake coin from A
//Input:	an array A that record the weigth of each coin
//Output:	coin record fake coin in the array A of loacation and weight 
void FakeCoin(Coins A,int num,Coin *coin);

//Atuo-generate weight
void AutoWeight(Coins *A,int *num);

//
void Output(Coins A);

//
void DecStart();

//Copy the Array A of the elements into array S
ArrayCopy(Coins S,const Coins A,int start,int end);



#endif DECCONPUER_H

⌨️ 快捷键说明

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