Bloomberg interview question

Given a tree, print elements in vertical level order