Question: Consider the following graph: E F G A D B Processing vertices in alphabetical order: (a) Represent the graph as an adjacenty list (b)
Consider the following graph: E F G A D B Processing vertices in alphabetical order: (a) Represent the graph as an adjacenty list (b) Represent the graph as an adjacenty matrix (c) Run BFS on the graph (starting with A) and draw the BFS tree along with non-tree edges. Label the levels of the tree corresponding to the distance from the root. (d) Run DFS on the graph again starting with A) and draw the DFS tree. Label the vertices with pre and post numbers. Classify the edges as tree edges, forward (non-tree) edges, cross edges, or back edges.
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Edge Classification Tree Edges A B B C C D D G G E F E A ... View full answer
Get step-by-step solutions from verified subject matter experts
