Question: Exercise 12.1: Create the following class Graph. Implement all function listed in class and test using menu driven program. class Graph { private: structNode {

 Exercise 12.1: Create the following class Graph. Implement all function listedin class and test using menu driven program. class Graph { private:

Exercise 12.1: Create the following class Graph. Implement all function listed in class and test using menu driven program. class Graph { private: structNode { int data; GNode *ptr: bool visited: }; GNode *GList: public: graph(); void Create(): voidInsertVertex(int): voidInsertEdge: void Display Vertices: voidDelete Vertex0: voidDelete Edgeso: boolSearch Vertex0; boolSearchEdge: voidBESTraversalo: voidDESTraversalo: Exercise 12.2: Write a function called Delal MinEdges(). This function will first search all the edges in the graph and will delete all those edges having minimum weight. Consider that graph is implemented using Adjacency List. Consider the following structure for both Vertices and Edges StructGNede { int weight; GNode *ptr; } *GList; Note: In the following example DelAll MinEdges() will delete the edge between vertex 4 to 3 and 1to 4 because of minimum weight. Data Weight *ptr Data Weight *ptr 2 1 -1 2 10 4 5 2 -1 2 3 15 4 20 3 3 -1 5 18 4 -1 3 5 5 -1 4 25 Exercise 12.1: Create the following class Graph. Implement all function listed in class and test using menu driven program. class Graph { private: structNode { int data; GNode *ptr: bool visited: }; GNode *GList: public: graph(); void Create(): voidInsertVertex(int): voidInsertEdge: void Display Vertices: voidDelete Vertex0: voidDelete Edgeso: boolSearch Vertex0; boolSearchEdge: voidBESTraversalo: voidDESTraversalo: Exercise 12.2: Write a function called Delal MinEdges(). This function will first search all the edges in the graph and will delete all those edges having minimum weight. Consider that graph is implemented using Adjacency List. Consider the following structure for both Vertices and Edges StructGNede { int weight; GNode *ptr; } *GList; Note: In the following example DelAll MinEdges() will delete the edge between vertex 4 to 3 and 1to 4 because of minimum weight. Data Weight *ptr Data Weight *ptr 2 1 -1 2 10 4 5 2 -1 2 3 15 4 20 3 3 -1 5 18 4 -1 3 5 5 -1 4 25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!