Binary Tree Level Order Traversal II

Binary Tree Level Order Traversal II. Given a binary tree, return the bottom-up level order traversal of its node’s values.  (ie, from left to right, level by level from leaf to root).

OR

Given a binary tree, return the reverse level order traversal of its nodes’ values. (i.e, from left to right and from the last level to starting level).

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.