Task For this assignment you are to create a C++ class that implements a graph using either an ad…
Task
For this assignment you are to create a C++ class that implements a graph using either an adjacency list or an adjacency matrix. Your class is to implement the following functions
– DFS
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines
Order Paper Now– BFS
– DFS Spanning Tree
– BFS Spanning Tree
Each function should take the node to start at as its parameter
Your program will take in 2 files. One called dat.txt and one called cmd.txt. dat.txt contains the list of nodes that are to be added to the graph and cmd.txt contains the commands to be run against your program.
File Format
dat.txt
<number of nodes>
<0 or 1 | directed or undirected>
<source node> <destination node>
Example file
7
1
1 3
1 4
1 2
2 4
2 5
3 4
3 6
4 5
4 6
4 7
5 7
6 7
cmd.txt
<command> <0 or 1 arguments>
Commands
– 1 bfs
– 2 dfs
– 3 bfs spanning
– 4 dfs spanning
Example File
1 1
2 1
3 1
4 1
Expectations
You should not use any already implemented code such as a library for your linked list
Your code should be well formatted with proper spacing and proper naming
Your code should have well named variables. No a’s b’s or c’s as names unless it is for something like a loop counter
Your code should have the same output formatting you see below
Example Output
DFS Stat 1 1 4 6 3 5 2 HFS Start 1 2 4 5 6 7 DFS Span tree start 1 DITS span tree start 1 K1. 23 1. 3) K1 4X2 5 K3. 6X4.