Accenture Interview Question

Bfs,dfs