decconquer.h
来自「算法实验:1 分治法在数值问题中的应用 ——最近点对问题 2 减治法在组合问题」· C头文件 代码 · 共 43 行
H
43 行
#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 + =
减小字号Ctrl + -
显示快捷键?