@ above he asked iterative .
.. use a stack to eliminate recursion ...
On Thu, Jul 8, 2010 at 9:00 PM, Anand <[email protected]> wrote:
> height(struct *node)
> {
> int left_height;
> int right_height;
> if(node == NULL)
> return 0;
> else
> left_height = height(node->left);
> right_height = height(node->right);
> return (1+ max(left_height, right_height));
>
>
> }
>
> On Thu, Jul 8, 2010 at 2:46 AM, sharad <[email protected]> wrote:
>
>> write algo to find hieght of BINARY tree ITERATIVELY
>>
>> --
>> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
With Regards,
Jalaj Jaiswal
+919026283397
B.TECH IT
IIIT ALLAHABAD
--
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.