Discussion: no :of nodes
Afficher un message
Vieux 07/05/2008, 20h16   #1
sophia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut no :of nodes

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);
}
  Réponse avec citation
 
Page generated in 0,05361 seconds with 9 queries