I posted this long b4 but dint see this error : Delivery to the following
recipient failed permanently: [email protected]
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
iteration*/);
}
void PrintSpiral(struct node* root, int level, bool bRTL/* Right-To-Left */)
{
if ( root == NULL) return;
if( level == 0 )
{
printf("%d", root->data)
return;
}
if( bRTL )
{
PrintSpiral(root->right,level-
1,bRTL)
PrintSpiral(root->left,level-1,bRTL)
}
else
{
PrintSpiral(root->left,level-1,bRTL)
PrintSpiral(root->right,level-1,bRTL)
}
}
On Tue, Nov 24, 2009 at 11:12 AM, Rohit Saraf
<[email protected]>wrote:
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.