(A) Give the search tree that results from running Depth First Search on the following graph, with source 0. Assume that adjacency lists are ordered from smallest to largest. {(0, 1),(0, 2),(0, 4),(1, 0),(1, 3),(1, 4),(2, 0),(2, 4),(2, 5),(3, 1),(4, 0),(4, 1),(4, 2),(4, 5),(4, 6), (5, 2),(5, 4),(6, 4),(6, 7),(6, 8),(6, 9),(7, 6),(7, 8),(7, 9),(8, 6),(8, 7),(9, 6),(9, 7)} (B) List the vertices encountered, ordered by starting time, when running DFS on the graph above. (C) List the vertices encountered, ordered by finish time, when running DFS on the graph above. (D) Give the search tree that results from running Breadth First Search, with source 0, on the graph above. (E) List the vertices in the order visited by BFS.
(A) Give the search tree that results from running Depth First Search on the following
graph, with source 0. Assume that adjacency lists are ordered from smallest to largest.
{(0, 1),(0, 2),(0, 4),(1, 0),(1, 3),(1, 4),(2, 0),(2, 4),(2, 5),(3, 1),(4, 0),(4, 1),(4, 2),(4, 5),(4, 6),
(5, 2),(5, 4),(6, 4),(6, 7),(6, 8),(6, 9),(7, 6),(7, 8),(7, 9),(8, 6),(8, 7),(9, 6),(9, 7)}
(B) List the vertices encountered, ordered by starting time, when running DFS on the
graph above.
(C) List the vertices encountered, ordered by finish time, when running DFS on the
graph above.
(D) Give the search tree that results from running Breadth First Search, with source 0,
on the graph above.
(E) List the vertices in the order visited by BFS.
Trending now
This is a popular solution!
Step by step
Solved in 7 steps