In bfs we have to look up each node and for each node we have to look all elements of row.Doesn't this require O(V^2)(number of elements in adjacency matrix) time and hence for adjacency matrix shouldn't total time be O(V^2+E).
In bfs we have to look up each node and for each node we have to look all elements of row.Doesn't this require O(V^2)(number of elements in adjacency matrix) time and hence for adjacency matrix shouldn't total time be O(V^2+E).