Level Order Zigzag

3 out of 4 test cases are showing Run Error. Help me identify the mistake in the code. https://ide.codingblocks.com/s/617751

Hi @anuragdeol2017
sry for delayed reply… there was just a minor mistake in ur code… ur base was missing
ie
if(root == NULL) {
return;
}
just add this to both functions… ur code will work fine…

corrected code --> https://ide.codingblocks.com/s/618863

hope it clears all ur doubts…

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.