I think this always return height 1. isn't it

On 4/17/07, BiGYaN <[EMAIL PROTECTED]> wrote:
>
>
> We will be calling the function like :
> height = getheight(root);
>
> and here's the function defination :
> int getheight ( node *p )
> {
>    if ( p==NULL )
>        return 0;
>    else
>        rh = getheight ( p->right );
>        lh = getheight ( p->left );
>        return ( (lh>rh ? lh : rh)+1 );
> }
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to