The time complexity of BFS when implemented on an adjacency list representation of a graph is _______.

  • O(E)
  • O(V + E)
  • O(V)
  • O(log V)
The time complexity of BFS (Breadth-First Search) when implemented on an adjacency list representation of a graph is O(V + E), where V is the number of vertices and E is the number of edges. This is because each vertex and edge are examined once during the traversal.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *