#include <iostream.h>
#include <stdlib.h>
#include "arraysort.h"
void random(int table[], int n)
{
int i=0;
while (i<n)
{
int value = rand() % 100;
if (value!=0)
table[i++] = value;
}
}
int main()
{
const int N=9;
int table[]={38,26,97,19,66,1,5,49,22};
int table1[]={38,26,97,19,66,1,5,49,22};
int table2[]={38,26,97,19,66,1,5,49,22};
int table3[]={38,26,97,19,66,1,5,49,22};
int table4[]={38,26,97,19,66,1,5,49,22};
int table5[]={38,26,97,19,66,1,5,49,22};
int table6[]={38,26,97,19,66,1,5,49,22};
cout<<"关键字序列:";
print(table, N);
insertSort(table, N);
shellSort(table1, N);
bubbleSort(table2, N);
quickSort(table3, N);
selectSort(table4, N);
heapSort(table5, N);
// heapSort(table6, N);
return 0;
}
数据结构课程设计(c++)排序算法的比较
5星 · 超过95%的资源 需积分: 17 166 浏览量
2010-06-29
18:23:46
上传
评论 4
收藏 242KB RAR 举报
w392395521
- 粉丝: 1
- 资源: 18