Amazon Interview Question

Bfs and DFS algorithm questions and complexity calculation