The time complexity of BFS is _______ when implemented using an adjacency list representation.

  • O(E log V), where E is the number of edges and V is the number of vertices
  • O(V + E), where V is the number of vertices and E is the number of edges
  • O(V^2), where V is the number of vertices
  • O(log E), where E is the number of edges
The time complexity of BFS when implemented using an adjacency list representation is O(V + E), where V is the number of vertices and E is the number of edges. This is because each vertex and each edge is processed once during the traversal.
Add your answer
Loading...

Leave a comment

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