Ask A Question

Subscribe You’re not receiving notifications from this thread.

anyone can help?

General • Asked about 1 year ago by Rajarat Veshist

Gravatar Rajarat Veshist Commented on May 30, 2019:

in, I don't get why

addEdge(src, dest) {
  // push to both adjacency lists   

we need to push to both? isn't edge for both?

Gravatar Jake from AlgoDaily Commented on May 31, 2019:

Hey Rajarat,

You need to push to both because it's an undirected graph-- the edge will always be bidirectional. If this were directed, it would point in one direction.

More reading at