-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_priorite.cpp
More file actions
executable file
·45 lines (34 loc) · 848 Bytes
/
test_priorite.cpp
File metadata and controls
executable file
·45 lines (34 loc) · 848 Bytes
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
#include "priorite.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
const int n = 15;
int main() {
srand((unsigned int) time(0));
vector<PointDist> v;
for (int i = 0; i < n; i++) {
v.push_back(PointDist(i, 0, double(i)));
}
FilePriorite Phil;
FilePriorite PhilTriee;
for (int i = 0; i < n; i++) {
Phil.push(v[i]);
}
for (int i = 1; i < Phil.v.size(); i++) {
cout << Phil.v[i].dist << endl;
}
cout << "" << endl;
cout << Phil.v.size() << endl;
cout << "" << endl;
PointDist a(0, 0, 0);
for (int i = 1; i < n; i++) {
a = Phil.pop();
cout << a.dist << endl;
PhilTriee.push(a);
}
for (int i = 1; i < PhilTriee.v.size(); i++) {
cout << PhilTriee.v[i].dist << endl;
}
return 0;
}