Question: 2. Graph traversals. Given the graph below, construct the visited list for (a) breadth-first search; and (b) depth-first search. Start at Arad. Stop when Bucharest

2. Graph traversals. Given the graph below, construct the visited list for (a) breadth-first search; and (b) depth-first search. Start at Arad. Stop when Bucharest is on the visited list. Show your work: at each step, show both the visited list and also what's in the stack/queue. Ordering: the order in which you add nodes to the data structure should be in alphabetical order. For example: when pushing the neighbors of Arad (A) onto the stack, the order should be: push(S), push(T), push(z); the same goes when queue: enqueue(S), enqueue(T), enqueue(Z). Oradea Neamt Iasi Zerind Arad Sibiu - Fagaras Vaslui Rimnicu Vilcea Timisoara Pitesti Lugoj Hirsova Urziceni Mehadia Bucharest Dobreta Craiova Giurgiu Eforie 2. Graph traversals. Given the graph below, construct the visited list for (a) breadth-first search; and (b) depth-first search. Start at Arad. Stop when Bucharest is on the visited list. Show your work: at each step, show both the visited list and also what's in the stack/queue. Ordering: the order in which you add nodes to the data structure should be in alphabetical order. For example: when pushing the neighbors of Arad (A) onto the stack, the order should be: push(S), push(T), push(z); the same goes when queue: enqueue(S), enqueue(T), enqueue(Z). Oradea Neamt Iasi Zerind Arad Sibiu - Fagaras Vaslui Rimnicu Vilcea Timisoara Pitesti Lugoj Hirsova Urziceni Mehadia Bucharest Dobreta Craiova Giurgiu Eforie
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
