Accenture interview question

Bfs,dfs