You need to log in or create an account to post to this user's Wall.
Chirag commented on the post, Printing a Binary Tree in Zig Zag Level-Order 9 months, 4 weeks ago
Instead of swapping the two stacks why dont we just use the two stacks to print in different order alternately like this :
void printLevelOrderZigZag(Node *root)
{
stack s1,s2;
s1.push(root);
Node […]Chirag joined the group Amazon Interview 10 months ago
Chirag joined the group Dynamic Programming 10 months ago
Chirag became a registered member 10 months ago
