Question: 3. (4pts) Given the graph G = (V, E) in the figure below, compute: (a) the BFS tree, (b) the DFS tree. In doing so

3. (4pts) Given the graph G = (V, E) in the figure below, compute: (a) the BFS tree, (b) the DFS tree. In doing so start with vertex 5 for both trees. For BFS, if a vertex has several adjacent vertices then process the vertices in sorted order from smallest to largest index. For example, vertex 10 has four adjacent vertices 14, 6, 12, 11 . Process vertex 6 first, then 11, 12 and finally, 14. Similarly, for DFS, if a vertex has several possible options, select the one with smallest index. To output the tree, you may draw it, or provide the adjacenty list of the tree where the vertices in each list are sorted from smallest to largest. 12 6 10 5 15 9 14 13 16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
