I have used a queue and stack to solve this problem. It is giving correct ans for 3 test cases out of 4. Only 3rd test case is failing. I am unable to get the reason.
This is my code https://ide.codingblocks.com/s/102782
Level Order (Zigzag)
hey @yfulwani82, your code is not giving right answer for these inputs. Dry run you code for this once
Input
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false true 88 false false
Your Output
10 30 20 40 50 60 73
Correct Output
10 30 20 40 50 60 73 88