-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
99 lines (68 loc) · 2.44 KB
/
main.cpp
File metadata and controls
99 lines (68 loc) · 2.44 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include <iostream>
#include <unordered_map>
#include "MovieCollection.cpp"
#include "Actor.cpp"
#include "Director.cpp"
#include "MovieTable.cpp"
#include "GenreRatingMap.cpp"
#include "GenreTable.cpp"
#include "RatingTable.cpp"
#include "YearTable.cpp"
int main()
{
// Master map that contains titles as keys and movie nodes as values.
MovieCollection master;
// Defining objects.
YearTable year_index;
RatingTable rating_index;
GenreTable genre_index;
GenreRatingMap genre_rating_index;
Actor actor_index;
MovieTable movie_index;
Director director_index;
// Creating Indices for fast lookup time.
year_index.createIndex(&master);
rating_index.createIndex(&master);
genre_index.createIndex(&master);
genre_rating_index.createIndex(&master);
actor_index.createIndex(&master);
movie_index.createIndex(&master);
director_index.createIndex(&master);
/*
ACTOR RELATED FUNCTIONS.
*/
// // --------------- Task - 1 ---------------
// actor_index.search("Brad Pitt");
// // --------------- Task - 2 ---------------
//actor_index.searchCoActors("Johnny Depp");
// // --------------- Task - 3 ---------------
// actor_index.searchUniqueCoActors("Francesca Capaldi");
// // --------------- Task - 4 ---------------
// actor_index.printCoActorsOfCoActors("Matt Damon");
// // --------------- Task - 5 ---------------
// actor_index.areCoActors("Matt Damon", "Igal Naor");
/*
DIRECTOR RELATED FUNCTIONS.
*/
// // --------------- Task - 6 ---------------
// director_index.search("Zack Snyder");
// // --------------- Task - 7 ---------------
// genre_index.printDirectorsOfGenre("Comedy");
/*
MOVIE RELATED FUNCTIONS.
*/
// // --------------- Task - 8 ---------------
// movie_index.printByName("Spider");
// // --------------- Task - 9 ---------------
// year_index.printByYear(2016);
// // --------------- Task - 10 ---------------
// year_index.printByYearDescending();
// year_index.printByYearAscending();
// // --------------- Task - 11 ---------------
// genre_index.printByGenre("Action");
// // --------------- Task - 12 ---------------
// rating_index.printByRating();
// rating_index.printByRating(8.4);
// // --------------- Task - 13 ---------------
// genre_rating_index.printByRating("Action");
}