Small issue: graph[from].add(to); should be .push (to) instead.
but also i am not getting same output as you for that portion of the function, can you specify the parameters you are calling with?
my graph variable shows
[ [ 2, 1 ], [], [ 3, 4 ], [ 6 ], [ 5, 6 ], [], [] ]
Small issue: graph[from].add(to); should be .push (to) instead.
but also i am not getting same output as you for that portion of the function, can you specify the parameters you are calling with?
my graph variable shows
[ [ 2, 1 ], [], [ 3, 4 ], [ 6 ], [ 5, 6 ], [], [] ]
Omg thanks for pointing out, the graph is of another problem I am working on and I miss-matched it.
Graph is :[[2,0],[2,1],[3,2],[4,2],[4,5],[6,3],[6,4]]
I have updated the code :).
Thanks again for pointing out my mistake.
Thanks for publishing this, and maintaining it.
I think the e.g input in the article has a mistake:
[5,4],
should be[4,5],
Thanks for reading the article :), and updated my mistake.
Hi,
Above the second diagram, it is still not corrected
For eg : if give data is [[2,0],[2,1],[3,2],[4,2],[5,4],[6,3],[6,4]]
I cannot see where you corrected that but it is still wrong just above step 1.
For eg : if give data is [2,0],[2,1],[3,2],[4,2],[5,4],[6,3...