|
דף
הבית >>עצים בינארים שאלות |
פיתרון תרגיל 14 .
|
int level(TREE *root, TREE *ptr, int n)
{
int x;
if(root==NULL)
return(-1);
else if(root==ptr)
return(n);
else
{
if((x=level(root->left,ptr,n+1))==-1)
x=level(root->right,ptr,n+1);
return(x);
}
}
|
|
 הקודם
|
|
הבא 
|
|