-
Notifications
You must be signed in to change notification settings - Fork 0
/
bfs.h
24 lines (20 loc) · 898 Bytes
/
bfs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <vector>
using namespace std;
class BFS{
private:
vector<vector<double>> adj; //adjacency matrix used for traversal
vector<int> q; //vector used for bfs (effectively a queue)
vector<string> airportNames; //airport Names mapped to it's given id
vector<int> bfs_output; // store all the index of traveled airports.
int num;
public:
BFS(); //default constructor
BFS(vector< vector <double> > copyMatrix, vector <string> copyNames); //copy constructor for dataset
void printMatrix(); //printMatrix for debugging
void addEdge(int x, int y); //helper function for testing
void traverse(int start); //bfs traversal algo input: start node output: traversed node
void printBFS();
vector<int> output();
int returnNum();
};