Single Choice Easy

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

ID: #21515 Time Complexity 89 views
Question Info
#21515Q 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 time complexity of BFS in a graph is O(V + E), where V is the number of vertices and E is the number of edges.

Share This Question

Challenge a friend or share with your study group.