5. Perform a depth-first search (DFS) on the following graph; whenever there's a choice of vertices, pick the one that i
Posted: Mon Jun 06, 2022 6:53 pm
5. Perform a depth-first search (DFS) on the following graph; whenever there's a choice of vertices, pick the one that is alphabetically first (Choose A as the starting node). Please draw the DFS trees and label post and pre value for each node. (12¹) N E procedure dfs (G) for all v € V: for all vEV: visited (v) = false if not visited (v): procedure explore (G, v) Input: Output: visited (u) is visited (v) = true previsit (v) for each edge (v, u) € E: postvisit (v) B M set to true for all nodes u reachable from v H D explore (v) G= (VE) is a graph; v EV if not visited (u): explore (u) G