BiTree T)Р{ Рint sum=0,m,n; Рif(T)Р{ Рif((!T->lchild)&&(!T->rchild)) Рsum++; Рm=Sumleaf(T->lchild); Рsum+=m; Рn=Sumleaf(T->rchild); Рsum+=n; Р} Рreturn sum; Р} Рvoid zhongxu(BiTree T)Р{ Рif(T)Р{ Рzhongxu(T->lchild); Рprintf("%c",T->data); Рzhongxu(T->rchild); Р} Р} Рvoid houxu(BiTree T)Р{ Рif(T)Р{ Рhouxu(T->lchild); Рhouxu(T->rchild); Рprintf("%c",T->data); Р}Р} Рmain()Р{ РBiTree T; Рint sum,sum1,sum3;Рprintf("请输入字符串:\n"); РT=Create(T);Рprintf("前序遍历:\n");РPreorder(T);Рprintf("\n"); Рprintf("中序遍历:\n");Рzhongxu(T);Рprintf("\n"); Рprintf("后序遍历:\n"); Рhouxu(T); Рprintf("\n"); Рsum=Sumleaf(T);Рprintf("树叶数为:\n"); Рprintf("%d",sum);Рprintf("\n");Рprintf("树结点数为:\n"); Рsum1=node(T);Рprintf("\n");Рprintf("%d",sum1);Рprintf("\n");Рprintf("树满结点数为:\n");Рsum3=mnode(T);Рprintf("%d",sum3);Рprintf("\n");Р}