Concerning the Breadth First Search (BFS) algorithm with a queue, observe the oriented graph below, and assume that the adjacency lists are arranged in decreasing order.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ3pIaHiF-zCEQRLPFOvuUrxnzXXkfeeonMk_MGXFN7jReEqstO4xW9tQm62qffLo3nsok65s6Ed4SyDaqhpp6AdXXq-P67_hj-NIcDUHOPMsriKE068kkPHrBtkuZ6btGgMRPzDyNQxS_44-bKqFL8uVZP7ZyeHGmR114LgdfFgKOEqhg7wWDfY0WKg/w288-h320/Graph%2002%20-%2010%20nodes.jpg)
Suppose you start a BFS in this graph from node 3. Select the option representing the order of node numbers loaded into the queue during this operation.
- 3 – 4 – 6 – 5 – 7 – 8 – 2 – 1 – 10
- 3 – 6 – 5 – 4 – 8 – 7 – 2 – 1
- 3 – 4 – 5 – 6 – 2 – 8 – 7 – 10 – 1
- 3 – 6 – 5 – 4 – 8 – 7 – 2 – 1 – 10
- None of the above.
Original idea by: Rubens de Castro Pereira
No comments:
Post a Comment