generated from COP3530/P2-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 971 Bytes
/
main.cpp
File metadata and controls
34 lines (29 loc) · 971 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
#include <iostream>
#include <vector>
#include "heap_sort.h"
#include "merge_sort.h"
#include "visualisation.h"
#include "Bridges.h"
#include "DataSource.h"
using namespace std;
using namespace bridges;
int main() {
Bridges bridges(2, "jedwardhicks", "250295652292");
DataSource ds;
dataset::ElevationData elevation_data;
try {
elevation_data = ds.getElevationData(-1, -1, 1, 1);
} catch(...) {
cerr << "Elevation data could not be read" << endl;
return 1;
}
vector<int> oneDimData;
for (int i = 0; i < elevation_data.getRows(); i++) {
for (int j = 0; j < elevation_data.getCols(); j++) {
oneDimData.push_back(elevation_data.getVal(i, j));
}
}
merge_sort(oneDimData, 0, oneDimData.size() - 1); // should be a choice
visualiseElevation(elevation_data, oneDimData); //sends the sorted elevation and coords to visualise
return 0;
}