#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100
typedef struct Node{
int data;
struct Node *lchild,*rchild;
}BiTNode,*BiTree;
void buildTree(BiTree *T){
char ch;
scanf("%c",&ch);
// printf("%c\n",ch);
if(ch=='#')
*T=NULL;
else{
*T=(BiTNode*)malloc(sizeof(BiTNode));
(*T)->data=ch;
buildTree(&(*T)->lchild);
buildTree(&(*T)->rchild);
}
}
void pre_order(BiTNode *p){
if(p){
printf("%c ",p->data);
pre_......
阅读全文