Does this implementation of DFS is correct or not .. and if not so could anyone correct it >:) this is the link of it. asked 22 Jun '15, 17:57

ok no problem with,also look at my implementation it may helpful. https://ideone.com/AGm2xe answered 22 Jun '15, 19:39

It looks correct to me (assuming the graph has only five nodes). You should look at the recursive implementation as well(if you haven't). It is shorter and more intuitive than using stack but also generally a tad bit slower. answered 22 Jun '15, 19:05
