ZigZag Tree Traversal GFG POTD Python Solution geeks for geeks problem of the day today
VS Code VS Code
218 subscribers
166 views
0

 Published On Mar 20, 2024

Problem - https://www.geeksforgeeks.org/problem...

Given a binary tree with n nodes. Find the zig-zag level order traversal of the binary tree.

Example 1:

Input:
1
/ \
2 3
/ \ / \
4 5 6 7
Output:
1 3 2 4 5 6 7
Example 2:

Input:
7
/ \
9 7
/ \ /
8 8 6
/ \
10 9
Output:
7 7 9 8 8 6 9 10

show more

Share/Embed