Gem Interview Question

Basic DFS/BFS tree question involving recursion