Dear all,
How good is this function which is used to find the no: of nodes
in each level of the binary tree. ?
int arrlev[100];
void preorder(struct btree *n,int lev)
{
if(!(n))
return;
arrlev[lev]++;
lev++;
preorder(n->left,lev);
preorder(n->right,lev);
}
How good is this function which is used to find the no: of nodes
in each level of the binary tree. ?
int arrlev[100];
void preorder(struct btree *n,int lev)
{
if(!(n))
return;
arrlev[lev]++;
lev++;
preorder(n->left,lev);
preorder(n->right,lev);
}
Comment