-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgorithm.cpp
More file actions
80 lines (47 loc) · 1.15 KB
/
algorithm.cpp
File metadata and controls
80 lines (47 loc) · 1.15 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// algorithm.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include"swap1.h"
#include"bubblesort.h"
#include"compare.h"
#include<iostream>
#include<stdlib.h>
#include"display.h"
#include"qksort.h"
#include"file.h"
#include"queue.h"
#include"zhedie.h"
#include<time.h>
#include"stack.h"
#include"straighinsert.h"
#include"shellsort.h"
#include"sort.h"
#include"binarysort.h"
#include"reverseword.h"
#include"heapsort.h"
#include"mergesort.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
clock_t start, finish;
double totaltime;
int a[13] = { 0, 2, 12, 1, 3, 456, 38,131, 1045, 74,9,5,4};
cout << "before the sort is:" << endl;
display(a, 13);
start = clock();
//qksort(a, 0, 12);
file();
finish = clock();
cout << "after the sort is:" << endl;
display(a, 13);
totaltime = (double)(finish - start) / CLOCKS_PER_SEC;
cout << "此算法运行的总时间为:" << totaltime <<"秒"<< endl;
//int a = (3 >3);
//cout << a << endl;
// ---------------------字符串原地反转--------------------------------//
/*char a[9] = { 'a', 'b', 'c', 'd', 'e', 'f', 'h', 'i' };
revese2(a, 9);
display(a, 9);
*/
return 0;
}