Given a binary tree. Print the nodes in vertical and zigzag manner.
For example, we have binary tree below:
1 / \ 2 3 / \ / \ 4 5 6 7
vertical traversal will output:
4
2
1 5 6
3
7
Given a binary tree. Print the nodes in vertical and zigzag manner.
For example, we have binary tree below:
1 / \ 2 3 / \ / \ 4 5 6 7
vertical traversal will output:
4
2
1 5 6
3
7