Reputation: 43
In case of undirected graph, since there are 2E edges in the adjacency list representation then why the memory requirement is same as that for directed graph?
Upvotes: 1
Views: 202
Reputation: 2028
Theta(V+E) = Theta(V+2E) since 2 is a constant and makes no difference in big-O notation.
Upvotes: 1