Single Choice Easy

QWhat is the time complexity of the breadth-first search (BFS) algorithm in a graph?

ID: #21499 Time Complexity 115 views
Question Info
#21499Q ID
EasyDifficulty
Time ComplexityTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A O(N) ✔ ✖
  • B O(log N) ✔ ✖
  • C O(N^2) ✔ ✖
  • D O(V + E), where V is the number of vertices and E is the number of edges. ✔ ✖
Correct Answer

Explanation

The breadth-first search (BFS) algorithm has a time complexity of O(V + E) in a graph.

Share This Question

Challenge a friend or share with your study group.