# Need c++ code for depth first search..



## vina_melody (Mar 21, 2005)

Does anyone know where can i find a complete c++ source code for depth first search using stack? if possible, with the explanation   

thanks


----------



## Krevinek (Mar 22, 2005)

Depends on the stack, are you using a stack someone else wrote or your own? If it is your own, it is pretty easy, just make sure you store pointers to both the base and the top of the stack, and use a double-linked list for the stack's storage. That way your searches can start from the top or the base of the stack, moving towards the other.


----------



## skywolf (Apr 14, 2005)

Try the following site for what looks like a solution to your problem...
http://www.cs.mcgill.ca/~cs251/OldCourses/1997/topic26/


----------

