All pastes #42643 Raw Edit

Stuff

public text v1 · immutable
#42643 ·published 2006-02-21 11:40 UTC
rendered paste body
Write a C program to find the depth or height of a tree.




Here is some C code to get the height of the three


tree_height(mynode *p)
{
   if(p==NULL)return(0);
   if(p->left){h1=tree_height(p->left);}
   if(p=>right){h2=tree_height(p->right);}
   return(max(h1,h2)+1);
}