Gem interview question

Basic DFS/BFS tree question involving recursion