作业帮 > 综合 > 作业

数据结构题

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/15 00:59:51
数据结构题
int count;
void OneCount(BiTree *T){
    BiTNode *p = T;
    while(p != NULL){
        if(p->left != NULL && p->right == NULL){
            count++;
            OneCount(p->left);
        }else if(p->left == NULL && p->right != NULL){
            count++;
            OneCount(p->right);
        }else if(p->left != NULL && p->right != NULL){
            OneCount(p->left);
            OneCount(p->right);
        }
    }
}
再问: 还有两道题也麻烦一下