In this article, we present 4 different approaches for Zig Zag Traversal of Binary Tree. The zigzag traversal of the binary tree can be better understood using below example:

For the above tree, the zigzag traversal will be : 1 2 5 6 7 3 4
There are many approaches for this problem like:
We can use two stacks and swap the values of these stacks at each level.We can use deque to solve problem. Depending upon the even or odd level we will push or pop.We can also use recursion. It will print th...
Published on April 12, 2021 09:34