Question: Question 5 [20 Marks] Graph in Figure 1 shows the adjacency matrix of a graph G. A B D A 0 1 0 0 B

 Question 5 [20 Marks] Graph in Figure 1 shows the adjacency

Question 5 [20 Marks] Graph in Figure 1 shows the adjacency matrix of a graph G. A B D A 0 1 0 0 B 1 0 1 0 Figure 1 1 0 0 0 D 1 0 1 0 a) Draw a picture of a graph G. b) Another way to present a graph is using adjacency lists. Draw an adjacency list for the graph G above. c) What is the type of graph G? class vertext public char label; public boolean wasVsited; public Vertex (char lab) { label = lab; wasVisited false; ) ) Figure 2 d) Using the class in Figure 2, show how each vertex in G is instantiated and store in array vertexList? e) Write a sniplet of java code to show how the adjacency matrix for graph G can be implemented

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!