Binary Tree Zigzag Level Order Traversal

Given a binary Tree, write a code to return binary tree zigzag level order traversal of its node’s values. (ie, from left to right, then right to left for the next level and alternate between).

In the screenshot below, We have printed the zigzag traversal of a binary tree. We have printed the values from left to right for the first level. For the second level, we then moved from right to left. Then for the next level, we move from left to right and so on.