Microsoft Interview Question

Write the code to spirally print a tree.