S&P Global interview question

Program to print a tree in zigzag format