-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRB-Tester.cpp
More file actions
47 lines (36 loc) · 1.13 KB
/
RB-Tester.cpp
File metadata and controls
47 lines (36 loc) · 1.13 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
/*
Use this to test the functionality of the OrderedMap class with the CSV data.
*/
#include <iostream>
#include <vector>
#include <string>
#include "Balanced-RB.cpp"
#include "CSV-Extractor.cpp"
using namespace std;
int main() {
//Allows to get the CSV data
vector<vector<vector<string>>> data;
data = csvExtraction().extractData();
if (data.empty()) {
cout << "No data extracted from the CSV file.\n";
return 1;
}
else {
cout << "Data extracted successfully.\n";
}
// This is a randomized test target
vector<string> target = {"Movie", "None", "None", "1-1.5hrs", "Drama"};
// The ordered map is made here and we go trough the top 5 recommendations made
cout << "Creating ordered map...\n";
RedBlackTree myMap( data , target);
cout<< "Ordered map created successfully.\n";
cout<< "Finding top 5 recommendations...\n";
vector<string> str= myMap.getTopKRecom(5);
int count = 1;
for(auto recoms: str){
cout << count << ". " << recoms << endl;
count++;
}
cout << "Top 5 recommendations found successfully.\n";
return 0;
}