Breadth First Search
1. Which of the following is a use of the extra 'visited' array in BFS?
2. What would happen if a stack were used instead of a queue to control the order of vertex processing in a standard graph traversal?
3. Why is the time complexity of BFS when an adjacency-list representation is used?
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 during BFS, assuming a vertex is marked visited when it is first added to the queue?
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 during BFS, assuming a vertex is marked visited when it is first added to the queue?
5. In an unweighted graph, what does the BFS level of a vertex represent relative to the source vertex?
6. Which of the following best explains why BFS processes a graph level by level?
7. Suppose a connected graph contains vertices. During a BFS traversal starting from one source, each vertex other than the source is assigned exactly one BFS-tree parent. How many edges are present in the resulting BFS tree?
8. If BFS is started from a vertex in a disconnected graph, what will happen?
9. Consider two vertices and in an unweighted graph. BFS discovers at level 2 and discovers directly from . Assuming has not been visited before, at which level will be placed?