Pocket Gems interview question

Simple binary tree problem