Apple interview question

BFS/DFS in trees, heap sort