I was wondering what is the time complexity of BFS, if I use:
Is it same as their spa
Time complexity necessarily depends on the representation.
As this link suggests, the time complexity with and adjacency list is O(V + E), and with an adjacency matrix is O(V2).