#include "PartitionPerf.h"

void main()
{
	// void timePartition(FILE *fp, int incN, int maxN, int numTrials, char *partitionAlg); //函数声明
    int incN = 5;   //设置数组初始长度
    int maxN=600;
    int numTrials = 200;//测试次数
	char partitionAlg[20]="Partition";  //算法的名称
	char outFileName[20];//测试结果存放的文件名
    
	FILE *fp; 
	errno_t err;
	//创建一个名为partitionAlg[i].txt的文件
	strcpy_s(outFileName,partitionAlg);
	strcat_s(outFileName,".txt");
	err = fopen_s( &fp,outFileName , "a+");
	printf( "# Results for %d  次测试" , numTrials);
	printf( "# n   time (msec)");
	printf( "# ---------------\n");
	//统计partitionAlg[i]算法对大小为incN，2*incN,3*incN,...,maxN的数组进行一次划分的时间
	timePartition(fp, incN, maxN, numTrials);
	fclose(fp);
	printf("done!  results in %s\n\n\n\n",partitionAlg);

	system("pause");
}

