Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.0 kB
0
Indexable
Never
/*
 Samarth Kamble
 21142 (F1-Batch)

 Problem statement:
 Assignment-6 Represent a given graph using adjacency list to perform DFS and BFS.
 Use the map of the area around the college as the graph.
 Identify the prominent landmarks as nodes and perform DFS and BFS on that.
 */
#include <iostream>
using namespace std;

class Node {
	string name;
	int data;
	Node *link;
public:
	Node() {
		name = "";
		data = -1;
		link = nullptr;
	}
};

class Graph {
	int vertices;
	int edges;
	Node *arr;
public:
	void setVE() {
		cout << "\nEnter vertices: ";
		cin >> this->vertices;
		cout << "\nEnter edges: ";
		cin >> this->edges;

		arr = new Node*[vertices];
		for (int i = 0; i < vertices; i++) {
			arr[i] = new Node();
		}
	}
} G;

int main() {
	bool menu = 1;
	while (menu) {
		int ch;
		cout << "\n\nMENU\n1.Take input\n2.\n3.\nEnter your choice: ";
		cin >> ch;

		switch (ch) {
		case 1:
			G.setVE();
			break;

		case 2:

			break;

		case 3:

			break;

		case -1:
			menu = 0;
			break;

		default:
			break;
		}
	}

	return 0;
}