Infosys interview question

DFS and BFS tree traversal