Pregunta de entrevista de Dialogic

Depth first search related problem. First as pseudo code and then in C++