Question: Exercise 1 . Traversals Let G be a graph with 8 nodes labeled A , B , C , D , E , F ,
Exercise Traversals
Let G be a graph with nodes labeled A B C D E F H J and let the adjacent nodes of each node be as follows:
a Draw G Also show the adjacency matrix for G
b On a copy of G label the nodes with numbers to show the order in which they would be visited in a DFS traversal starting at node A Also, show which are the discovery edges by making them red and directed alternately make them thicker rather than red
NOTE: for your traversals, assume that the adjacent nodes of any given node are returned in the same order as they are listed above.
c On a copy of G label the nodes with numbers to show the order in which they would be visited in a BFS traversal starting at node A Also, show which are the discovery edges by making them red and directed alternately make them thicker rather than red
NOTE: the discovery edges should form a tree rooted at A aka search tree.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
