-
Notifications
You must be signed in to change notification settings - Fork 0
/
StructuresTest.cpp
85 lines (71 loc) · 2.13 KB
/
StructuresTest.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <string>
#include "Sort.h"
#include "BinarySearchTree.h"
#include "Graph.h"
using namespace std;
void fill(int *arr, int size) {
for(int i = 0; i < size; i++) {
arr[i] = rand() % 100;
}
}
int main()
{
srand(time(NULL));
int N[] = {10, 20};
for(int i = 0; i < 2; i++) {
int *values = new int[N[i]];
fill(values, N[i]);
Sort::print(values, N[i]);
Sort::quicksort(values, N[i]);
Sort::print(values, N[i]);
delete [] values;
values = new int[N[i]];
fill(values, N[i]);
Sort::print(values, N[i]);
Sort::mergesort(values, N[i]);
Sort::print(values, N[i]);
delete [] values;
}
BinarySearchTree *tree = new BinarySearchTree();
cout << endl << "ADDED VALUES: ";
for(int i = 0; i < 10; i++) {
double num = rand() % 100;
cout << num << " ";
tree->insert(num, "TEST");
}
cout << endl;
tree->printInOrder();
delete tree;
EvaluationGraph *graph = new EvaluationGraph(6);
graph->insert(1, 1);
graph->insert(1, 1);
graph->insert(1, 1);
graph->insert(1, 1);
graph->insert(2, 3);
cout << "COUNT OF 1: " << graph->numLoops(1) << endl;
cout << "COUNT OF 2: " << graph->numLoops(2) << endl;
cout << "DFS CONSECUTIVE: " << graph->strictDFS() << endl;
graph->clear();
graph->insert(0, 1);
graph->insert(1, 2);
graph->insert(2, 3);
graph->insert(5, 5);
cout << "COUNT OF 1: " << graph->numLoops(1) << endl;
cout << "COUNT OF 5: " << graph->numLoops(5) << endl;
cout << "DFS CONSECUTIVE: " << graph->strictDFS() << endl;
graph->clear();
graph->insert(0, 1);
graph->insert(1, 3);
graph->insert(3, 4);
graph->insert(4, 5);
cout << "COUNT OF 1: " << graph->numLoops(3) << endl;
cout << "COUNT OF 5: " << graph->numLoops(5) << endl;
cout << "DFS CONSECUTIVE: " << graph->strictDFS() << endl;
return 0;
}
*/