##. I have done some part of this program I just need to work on the remaining functions such as dislayDFS, displayBSF, and bool isBipartite. You should not use additional functions and everything nee


// FILE: StackInt.cpp
// DESCRIPTION: Class implementation for a stack of integers
// NOTE: You are not allowed to modify this file.
#include <iostream>
#include <cstdlib>
using namespace std;
#include "StackInt.h"
// Add an integer to the top of the stack.
void StackInt::push(int val)
{
stackObj.push(val);
}
// Removes and returns an integer from the top of the stack. Aborts the
// program is the stack is empty.
int StackInt::pop()
{
int val = top();
stackObj.pop();
return val;
}
// Returns but does not remove the integer at the top of the stack. Aborts the
// program is the stack is empty.
int StackInt::top() const
{
if (isEmpty()) {
cerr << "Tried to access empty stack --> aborting program" << endl;
exit(-1);
}
return stackObj.top();
}
// Returns true if the stack is empty.
bool StackInt::isEmpty() const
{
return stackObj.empty();
}

// FILE: QueueInt.cpp
// DESCRIPTION: Class implementation for a queue of integers
// NOTE: You are not allowed to modify this file.
#include <iostream>
#include <cstdlib>
using namespace std;
#include "QueueInt.h"
// Add an integer to the back of the queue.
void QueueInt::enqueue(int val)
{
queueObj.push(val);
}
// Removes and returns an integer from the front of the queue. Aborts the
// program is the queue is empty.
int QueueInt::dequeue()
{
int val = front();
queueObj.pop();
return val;
}
// Returns but does not remove the integer at the front of the queue. Aborts the
// program is the queue is empty.
int QueueInt::front() const
{
if (isEmpty()) {
cerr << "Tried to access empty queue --> aborting program" << endl;
exit(-1);
}
return queueObj.front();
}
// Returns true if the queue is empty.
bool QueueInt::isEmpty() const
{
return queueObj.empty();
}

/ FILE: main.cpp
// DESCRIPTION: Tests Graph class
// NOTE: You are not allowed to modify this file.
#include <iostream>
using namespace std;
#include "Graph.h"
int main(int argc, char *argv[])
{
argv[1] = "graph0.txt";
Graph g(argv[1]);
cout << endl << "Adjacency Matrix" << endl;
g.display();
g.displayDFS(0);
g.displayBFS(0);
cout << "Bipartite: ";
if (g.isBipartite())
cout << "TRUE";
else
cout << "FALSE";
cout << endl;
return 0;
}

// FILE: Graph.cpp
// DESCRIPTION: Implementation of the Graph class.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
#include "Graph.h"
#include "QueueInt.h"
#include "StackInt.h"
// Constructor: load the graph from a file
Graph::Graph(char *filename)
{
ifstream myfile;
myfile.open (filename); // open file named filename
if ( myfile.is_open() ) { // check if the file is open
cout<<"\n"<<filename<<":"<<endl; // prints out the name of the file
string line;
getline(myfile, line); // store and get the next line
n = stoi(line); // convert the into int to access the vertix num
adjMatrix = new int*[n]; // matrix initialized
for(int i = 0; i < n; i++){
adjMatrix[i] = new int[n];
for(int j = 0; j < n; j++){
adjMatrix[i][j] = 0; // make element in the metrix equal to zero
}
}
while (getline(myfile, line)) { // keep storing and going to the next line
int a = stoi(line.substr(0, 1));
int b = stoi(line.substr(2,1));
adjMatrix[b][a] = 1;
adjMatrix[a][b] = 1;
}
}
else {
cout << "Couldn't open file\n";
}
}
// Destructor
Graph::~Graph()
{
if(!adjMatrix) { // if adjmatrix is not nullptr
for(int i = 0; i < n; i++ ){
delete [] adjMatrix[i]; // delete the adjMatrix from i through n
}
delete [] adjMatrix;
}
}
// Display the adjacency matrix
void Graph::display() const
{
//using nested for loop to display columns and row of the matrix
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n; j++)
{
cout<< adjMatrix[j][i] <<" ";
}
cout<<endl;
}
}
// Displays the depth first search starting at the given vertex
void Graph::displayDFS(int vertex) const {
}
// Perform breadth first search starting at the given vertex
void Graph::displayBFS(int vertex) const
{

Graph.csv


5
0 1
1 2
2 4
3 2
4 0
1 3