What is the time complexity of BFS traversal of a graph with V vertices and E edges?
16 views
- O(V²)
- O(E log V)
- O(V + E) (Correct Answer)
- O(V log E)
Explanation
BFS visits each vertex once and explores each edge once, resulting in a time complexity of O(V + E). This efficiency makes it suitable for large sparse graphs.