遞歸算法--二叉樹中度爲2的結點

int Degree2(BitNode *t){html

if(t==null) 
    
    return 0;

if(t->lchild!=null&&t->rchild!=null)
    
    return 1+Degree2(t->lchild)+Degree2(t->rchild);

return Degree2(t->lchild)+Degree2(t->rchild);

}算法


您可能感興趣的
code

相關文章
相關標籤/搜索