Need c++ code for depth first search..

vina_melody

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

thanks :)
 
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.
 
Back
Top