-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListGraph.h
More file actions
23 lines (18 loc) · 750 Bytes
/
ListGraph.h
File metadata and controls
23 lines (18 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include <unordered_map>
#include <string>
#include <set>
/* Welcome to the Adjacency-List based graph
-The class takes in Custer's unordered_map<string, set<string>> and uses a const reference
to that unordered map AS the adjacency list.
-Therefore, there are not insert
*/
class ListGraph
{
std::unordered_map<std::string, std::set<std::string>>& adjList;
//Key = string artist, value = set adjacent artists in string form
public:
ListGraph(std::unordered_map<std::string, std::set<std::string>>& _adjList);
bool CheckArtist(std::string artist); //checks if an artist exists in the map (As a key)
std::set<std::string>& GetAdjacents(std::string artist); //returns a string set of adjacent artists
};