Compass Interview Question

Code challenge, binary tree traversal