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}}
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 10Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started