Re: [algogeeks] Re: Print binary tree in spiral

2009-11-23 Thread Arun
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.

Re: [algogeeks] Re: Print binary tree in spiral

2009-11-23 Thread Rohit Saraf
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

Re: [algogeeks] Re: Print binary tree in spiral

2009-11-23 Thread Algoose Chase
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