Level Order ( Zigzag )


plz help me with the logic,im not getting it

Basically here you have to follow the approach that,

int h=height(root);
bool ltr=false;
for(int i=1;i<=h;i++)
{
printAtLevel(root,i,ltr);
ltr=!ltr;
}

So you need to build a function printAtLevel based on the ltr value, wheather its true or false, and based on that you will print either from left to right or from right to left, this is the basic approach you need to follow up.