#include<stdio.h>
#include<stdlib.h>
typedef struct BiTNode{
char data;
struct BiTNode *lchild,*rchild;
}BiTNode, *BiTree;
void CreateBiTree(BiTree *T)
{
char c;
scanf("%c",&c);
if(c=='#'){
*T=NULL;}
else{
*T=(BiTNode*)malloc(sizeof(BiTNode));
(*T)->data=c;
CreateBiTree(&((*T)->lchild));
CreateBiTree(&((*T)->rchild));
}
}
void InOrderTraverse(BiTree T)
{
if(T)
{
InOrderTraverse(T->lchild);
printf("%c",T->data);
InOrderTraverse(T->rchild);
}
}
void PostOrderTravese(BiTree T)
{
if(T)
{
PostOrderTravese(T->lchild);
PostOrderTravese(T->rchild);
printf("%c",T->data);
}
}
void main(){
BiTree T=NULL;
CreateBiTree(&T);
InOrderTraverse(T);
PostOrderTravese(T);
}