Domanda di colloquio di Amazon

Bfs and DFS algorithm questions and complexity calculation