Question: Given the following undirected graph G = (V, E) where: V = {1,2,3,4,5,6,7,8,9,10} and E = {{1,2}, {2,3}, {3,4}, {5,6}, {6,7}, {7,8}, {1,5}, {2,6}, {3,7},

Given the following undirected graph G = (V, E) where:

V = {1,2,3,4,5,6,7,8,9,10}

and E = {{1,2}, {2,3}, {3,4}, {5,6}, {6,7}, {7,8}, {1,5}, {2,6}, {3,7}, {4,8}, {1,9}, {9,3), {6,10}, {10,8}}

Given the following undirected graph G = (V, E) where: V =

a) Draw the adjacency matrix and the adjacency list for the graph (remember that the adjacency list keeps the neighbors sorted).

b) Starting from vertex 3:

i. Apply DFS to it: 1) Give the sequence of the vertices visited, 2) Redraw the graph marking the edges that make the DFS tree, and 3) Draw the DFS tree rooted at 3.

ii.Apply BFS to it: 1) Give the sequence of the vertices visited, 2) Redraw the graph marking the edges that make the BFS tree, and 3) Draw the BFS tree rooted at 3

9 3 4 1 2 7 8 5 6 10

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!