Question: Hi, i would like some help regarding the question and did you go about solving it below: The start vertex = a . The answer
Hi, i would like some help regarding the question and did you go about solving it below:
The start vertex = a.

The answer format to be something like this:


Thank you.
start vertex = a: List the order in which the vertices of the graph shown in Figure 1 are visited when the following methods are applied ith the start vertex = (a) the breath-first-search (b) depth-first-search Assume that the vertices are listed in increasing order in each adjacency list. 8 C 13 7. 8 10 h 7 8 11 5 17 20 Example Breadth-First-Search (s) 2 1) visit s, label s as visited. 2) add s to a queue (a queue is a first-in-first out data structure) q. 3) while q is not empty: i. get the front value of q and store it as 5 3 40 V ii. visit each unvisited vertex u, such that is v is adjacent to u, and add u to the queue q. iii. remove the front value of q 8 010911 The list of vertices visited in order is: A B C D E F G H I J K L ffffffffffff Example Depth-First-Search (v) 1) visit v, label v as visited. 2) For each unvisited vertex u, such that v is adjacent to u, visit it using 10% 11 Depth-First-Search on u. 9 2 3 78 The list of vertices visited in order is: A B D G I HJ K L CEF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
