Question: C++ Given the following undirected graph (you can move backward and forward between nodes): a) You were asked to search the graph starting from Node
C++
Given the following undirected graph (you can move backward and forward between nodes): a) You were asked to search the graph starting from Node 1, Depth First. Explain which data structure would you be using to perform the search efficiently? Show the content of the data structure used in each of your searching steps when nodes are added to or deleted from the data structure. b) Suppose the graph is modified to a directed graph (you can only move along the direction of the arrows) as shown below: You were asked to do the Depth First search again starting from Node 1. Show the content of the data structure used in each of your searching steps when nodes are added to or deleted from the data structure. Copy the graph and highlight the shortest path from Node 3 to Node 4 assuming all paths have equal cost / weight of 1 unit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
