-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
35 lines (29 loc) · 853 Bytes
/
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
#include "SortAlgorithm.h"
#include "Test.h"
#include <iostream>
int main( )
{
Test t;
t.add( "Bubble Sort", bubbleSort );
t.add( "Select Sort", selectSort );
t.add( "Insert Sort", insertSort );
t.add( "Merge Sort", mergeSort );
t.add( "Count Sort", countSort );
t.add( "Quick Sort", quickSort );
t.add( "Quick Sort2", quickSort2 );
t.add( "Heap Sort", heapSort );
if ( t.test( ) )
{
cout << "**************** Pass!! *******************" << endl;
map<string, long > elapsed_times = t.calcTime( 10000 );
for ( auto it = elapsed_times.begin( ); it != elapsed_times.end( ); ++it )
{
cout << it->first << " : " << it->second << endl;
}
}
else
{
cout << "**************** Fail!! ******************" << endl;
}
return 0;
}