I've have one solution using two stacks, fs (forward stack) to print
elements in forward manner and rs to print in reverse.
Basic idea is while printing elements in forward order, put the elements in
reverse stack so that the while popping the reverse stack the last element
in row is popped first.
And it cannot be made more efficient.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
I posted this long b4 but dint see this error : Delivery to the following
recipient failed permanently: algogeeks@googlegroups.com
re-posting:
BST_Spiral(struct node* root)
{
ht = Height(root);
for( i = 0; i= ht; i++)
{
PrintSpiral(root, i, i%2 /*flip 1 and 0 alternately on each