Question: What is the time complexity of a breadth-first search (BFS) in a graph?
Options:
Correct Answer: O(V + E)
Solution:
BFS visits each vertex and edge once, leading to a time complexity of O(V + E), where V is vertices and E is edges.