Breadth First Search

1. Which of the following is a use of the extra ‘visited’ array (the array used to keep track of which nodes have been visited/traversed) in BFS?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. What would happen if we used a stack instead of a queue in BFS?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. Why is the time complexity of BFS O(|V| + |E|)?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. Consider the following graph:
Vertices, V = [a, b, c , d, e, f]
Edges, E = [[a, b], [a c], [b, d], [b, e], [c, e], [c, f]]
Where each array within E signifies an edge between the two mentioned vertices and a is the root.
Which of the following represents the correct sequence of the queue used in BFS to traverse the above graph?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation