We know there is an O(n+m)
solution (DFS or BFS) for checking if there is a path from s
to t
in a Undirected Graph G
with n
vertexes and m
edges... that would be implemented via an adjacency List.
If I implement my program with Adjacency Matrix, will the runtime be affected? Is this a good or bad choice?
Edit: I Need to calculate the time complexity, in this way, any idea?