forked from guanshan/allsort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
64 lines (61 loc) · 2.02 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "allSort.h"
#include "allSort.cpp"
using namespace std;
int main()
{
//在int上测试
int a[]={3,2,6,7,1,9};
allSort<int> iTest;
iTest.insertSort(a,6);
cout << "int 数组,插入排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
/* iTest.selectSort(a,6);
cout << "int 数组,选择排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
iTest.bubbleSort(a,6);
cout << "int 数组,冒泡排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
iTest.mergeSort(a,6);
cout << "int 数组,归并排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
iTest.quickSort(a,6);
cout << "int 数组,快速排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
iTest.heapSort(a,6);
cout << "int 数组,堆排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;*/
iTest.shellSort(a,6);
cout << "int 数组,希尔排序结果:" << flush;
iTest.printArray(a,6);
cout << "============================" << endl;
//在char上测试
/* char b[]={'3','2','6','7','1','9'};
allSort<char> cTest;
cTest.insertSort(b,6);
cout << "char数组,插入排序结果:" << flush;
cTest.printArray(b,6);
cout << "============================" << endl;
cTest.selectSort(b,6);
cout << "char数组,选择排序结果:" << flush;
cTest.printArray(b,6);
cout << "============================" << endl;
cTest.bubbleSort(b,6);
cout << "char数组,冒泡排序结果:" << flush;
cTest.printArray(b,6);
cout << "============================" << endl;
cTest.mergeSort(b,6);
cout << "char数组,归并排序结果:" << flush;
cTest.printArray(b,6);
cout << "============================" << endl;
cTest.quickSort(b,6);
cout << "char数组,快速排序结果:" << flush;
cTest.printArray(b,6);
cout << "============================" << endl;*/
return 0;
}