首页 › 答案 › 题库 › 远程教育 › 联大学堂

设二叉树以二叉链表的形式存储,有关类型定义如下: typedef struct BiTNode { // 结点结构 int data; struct BiTNode *lchild, *rchild; // 左右孩子指针 } BiTNode, *BiTree; 下面是求二叉树上叶子结点个数的类()C算法,请填空。 int Leaf()number ( BiTree T ) //T是树的根结点的指针 { } // Leaf()number

设二叉树以二叉链表的形式存储,有关类型定义如下: typedef struct BiTNode { // 结点结构 int data; struct BiTNode *lchild, *rchild; // 左右孩子指针 } BiTNode, *BiTree; 下面是求二叉树上叶子结点个数的类()C算法,请填空。 int Leaf()number ( BiTree T ) //T是树的根结点的指针 { } // Leaf()number
正确答案:if|else