统计二叉树结点-简单的2行代码

int count(BTNode *T)
{
    if(T==NULL)
        return 0;
    else
        return count(T->lchild) + count(T->rchild) + 1;
}

 

posted on 2017-06-20 21:10  多情剑客无情剑;  阅读(138)  评论(0编辑  收藏  举报

导航