Amadeus interview question

BFS code and DFS code.