Question 2

Write a function that accepts root of a binary tree and print zigzag level order traversal, each level print in new line.
For example,
Given tree:
1
2 3
4 5 6 7
8 9
output:
1
2 3
7 6 5 4
8 9

[advanced_iframe securitykey=”undefined” src=”https://code.kodnest.com/” width=”100%” height=”600″]

Register for the new batch at KodNest and start your journey to success.Secure Your Spot Now!Claim Your Seat

Request A Callback

Get a Free 30-minute Counseling session with our experts.