-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project1.hpp
94 lines (75 loc) · 1.87 KB
/
Project1.hpp
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
//Noorain Baig
//Project 1
//CSCI 2270/Data Structures
//Section 310
#include <iostream>
struct vertex;
struct adjVertex {
vertex * v;
adjVertex * next;
adjVertex * prev;
int weight;
};
struct vertex
{
std::string key;
int index;
int districtID;
//vertex * parent;
std::string INFECT;
// bool solved;
vertex * next;
bool solved;
bool visited;
int distance;
std::string previous;
adjVertex * head;
};
class LinkedList {
private:
adjVertex * head;
public:
LinkedList();
//LinkedList(vertex * new_vertex, vertex * city_name, int weight);
void ReadAdjVertices(vertex * new_vertex, vertex * city_name, int weight);
};
class Graph {
private:
vertex * head;
std::string key;
int index;
int districtID;
std::string INFECT;
vertex * next;
bool solved;
bool visited;
int distance;
std::string previous;
int queueSize;
int maxQueue;
vertex * queue;
public:
Graph();
~Graph();
Graph(std::string key, int index, int districtID, vertex * next, bool solved, bool visited, int distance, std::string previous);
vertex * insertVertex(std::string key, int count);
vertex * FindKeyVertex(std::string city_name);
vertex * FindVertex(int value);
void ShortestUnweightedPath(std::string vertice1key, std::string vertice2key);
string DijkstrasAlgorithm(std::string start, std::string end, int count);
void print();
void ClearPrevious();
void SetDistrictID(int count);
void addElement(vertex * solved[], vertex * addin);
bool isSolved(vertex * input_vertex, vertex * solved[], int size);
void ReadMore(string infect, int count, int p);
int Infection(int t);
vertex * gettail();
int isFull();
int isEmpty();
int enqueue(string v);
string dequeue();
//printVertices(); //breadth or depth first search
//for bool, take in two vertices, and find their weight,
// void insertEdge();
};