[C] 统计二叉树中叶子结点的数目(链表结构) →→→→→进入此内容的聊天室

来自 , 2019-12-11, 写在 C, 查看 134 次.
URL http://www.code666.cn/view/7b1ce3d7
  1. int CountLeaf2(BiTree bt)
  2. {/*开始时,bt 为根结点所在链结点的指针,返回值为bt 的叶子数*/
  3.     if ( bt==NULL ) return ( 0 );
  4.     if ( bt->lchild==NULL && bt->rchild==NULL ) return ( 1 );
  5.             return ( CountLeaf2 ( bt->lchild ) +CountLeaf2 ( bt->rchild ) );
  6.         }
  7.  
  8.  

回复 "统计二叉树中叶子结点的数目(链表结构)"

这儿你可以回复上面这条便签

captcha