Function to find the height of a binary tree
int height(struct node *t)
{
if(t == NULL)
return 0;
int left = height(t -> Llink);
int right = height(t -> Rlink);
if(left > right)
return left + 1;
else
return right + 1;
}
}
Written by Munia Balayil
No comments:
Post a Comment