any approach for this question ??
Level order zig zag
use simple level order Traversal
but maintain one variable int level =0
if level is even then print in normal order
otherwise in reverse order
container konsa use kru ?? nodes ko store krne ke liye
lecture m queue se kiya tha
yes you can use queue
and for reversing you can use stack/queue
this is the code https://ide.codingblocks.com/s/600865
all test cases passed
but can this code be more efficient or any other efiicient approach ??
there may be some few more methods to solve this
but time and space complexity is nearly same
this is correct
oh! thank you …
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.