#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#define MaxSize 50
//中缀表达式树加括号
//记住
void BiTreeToExp(BiTreeC T,int deep){
if(!T)
return;
if(!T->lchild && T->rchild)
printf("%d",T->data);
else{
if(deep>1)
printf("(");
BiTreeToExp(T->lchild,deep+1);
printf("%c",T->data);
BiTreeToExp(T->rchild,deep+1);
if(deep>1)
printf(")");
}
}
04-16
5597
03-06
667