Back to the 2022 paper

Module 3: Graph and Tree Algorithms

20222m

BFS on a graph G=(V,E)G = (V, E) has running time
(i) O(∣V∣+∣E∣)O(|V| + |E|)
(ii) O(∣V∣)O(|V|)
(iii) O(∣E∣)O(|E|)
(iv) None of these

Worked SolutionAI Assisted

Answer: (i) O(|V|+|E|)

BFS visits each vertex and edge once using adjacency list.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.