Time Complexity of Breadth First Search is? (V – number of vertices, E – number of edges)
a) O(V + E)
b) O(V)
c) O(E)
d) O(V*E)
Answer:
a) O(V + E)
Explanation:
Because the Breadth First Search visits each node and edge only once (in the worst scenario), its time complexity is O(V + E).
Read more: Different learning methods does not include