统计二叉树叶子节点的数目

int LeafCount(BiTree T)
{
if(T==NULL)
return 0;
if(T->lchild==NULL&&T->rchild==NULL)
return 1;
else
return LeafCount(T->lchild)+LeafCound(T->rchild);
}

posted on 2016-10-29 21:53  Dove1  阅读(422)  评论(0编辑  收藏  举报