1. Engineering
  2. Computer Science
  3. 1 25 depthfirst search algorithm tracingl consider the recursive depthfirst...

Question: 1 25 depthfirst search algorithm tracingl consider the recursive depthfirst...

Question details

1. (25) [Depth-first search: algorithm tracingl Consider the recursive depth-first search algorithm, the graph, and its adjacency list representation shown below. Consider the nodes in a linked list of the adjacency list in the order from left to right exactly as shown. Do algorithm tracing on the graph twice, once for the start vertex 2 and once for the start vertex 6, and show the tracing output. The tracing output should include the sequence of recursive calls and returns from those calls in the following format: call DFS(a); call DFS(b); call DFS(c); return from DFS(c); call DFS(d); return from DFS(d); return from DFS(b); return from DFS(a). Additionally, show the depth-first search tree resulting from each run of the algorithm; use the format shown in Figure 3.5(g) of the textbook (page 85). Note this is not a programming exercise DFS(u): Depth-first search tree Mark u as Explored and add u to T For each edge (u, v) incident to u If v is not marked Explored then Recursively invoke DFS(v) Endif Endfor 3 4 4 2 5 2 6 5 7 3 8 3 44 4 4 4

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution