Пример #1
0
void houxu(BiTree T)
{ 
    if (T) { 
        houxu(T->lchild); 
        houxu(T->rchild); 
        printf("%c",T->data); 
    } 
}
Пример #2
0
void main()
{
    BiTree T;
    int sum,dep;
    printf("please input data: ");
    T=Create(T);
    printf("xianxu: ");
    Preorder(T);
    printf("\n");
    printf("zhongxu: ");
    zhongxu(T);
    printf("\n");
    printf("houxu: ");
    houxu(T);
    printf("\n");
}
Пример #3
0
int main()
{ 
    BiTree T = NULL; 
    int sum,dep;
    T = Create(T); 
    Preorder(T); 
    printf("\n"); 
    zhongxu(T); 
    printf("\n"); 
    houxu(T); 
    printf("\n"); 
    sum=Sumleaf(T); 
    printf("%d",sum); 
    dep=Depth(T); 
    printf("\n%d",dep); 
    return 0;
}