For a graph with V vertices and E edges, BFS time complexity is:
12 views
- O(V²)
- O(E log V)
- O(V + E) (Correct Answer)
- O(log V)
Explanation
BFS traverses each vertex and edge once, leading to O(V + E). Efficient for sparse graphs.
BFS traverses each vertex and edge once, leading to O(V + E). Efficient for sparse graphs.
No comments yet. Be the first to comment!
Explore thousands of MCQs across every exam category on Exams Nepal.
Find More MCQs