Pergunta de entrevista da empresa Microsoft

Given a binary three write a function that will print out its nodes in a zig-zag order starting from the top e.g. print the head node, then the second level from left to right, the third from right to left etc.