Amazon interview question

BFS and DFS and time and space complexity