/* THIS CODE HAS BEEN TESTED AND IS FULLY OPERATIONAL. Problem Statement: Represent a given graph using adjacency matrix/list to perform DFS and using adjacency list to perform BFS. Use the map of the area around the college as the graph. Identify the prominent land marks as nodes and perform DFS and BFS on that. Code from DataStructuresAndAlgorithms (SPPU - Second Year - Computer Engineering - Content) repository on KSKA Git: https://git.kska.io/sppu-se-comp-content/DataStructuresAndAlgorithms/ */ // BEGINNING OF CODE #include #include #include using namespace std; void dfs(vector> &g, int start, vector &vis) { vis[start] = 1; cout<>& g, int start) { vector vis(g.size(),0); queue q; q.push(start); vis[start]=1; while(!q.empty()){ int cur=q.front(); q.pop(); cout<>& graph) { int V = graph.size(); vector> adjacencyMatrix(V, vector(V, 0)); for (int i = 0; i < V; i++) { for (int j : graph[i]) { adjacencyMatrix[i][j] = 1; } } cout << "Adjacency Matrix:\n"; for (int i = 0; i < V; i++) { for (int j = 0; j < V; j++) { cout << adjacencyMatrix[i][j] << " "; } cout << endl; } } int main() { int V,E; cout << "Number of vertices:\t"; cin >> V; vector> g; for(int i=0;i temp; g.push_back(temp); } cout << "Number of edges:\t"; cin >> E; for(int i=0;i>a; cout<<"End node:\t"; cin>>b; g[a].push_back(b); g[b].push_back(a); } displayAdjacencyMatrix(g); vector vis(V,0); cout<