#include <stdio.h>
#include <stdlib.h>
// 二叉树节点结构体定义
typedef struct BiTNode {
char data;
struct BiTNode *lchild;
struct BiTNode *rchild;
} BiTNode, *BiTree;
// 中序建立二叉树
void CreateBiTreeInorder(BiTree *T) {
char ch;
scanf("%c", &ch);
if (ch == '#') {
*T = NULL;
} else {
*T = (BiTNode *) malloc(sizeof(BiTNode));
(*T)->data = ch;
// 先建立左子树
CreateBiTreeInorder(&(*T)->lchild);
// 再建立右子树
scanf("%c", &ch);
if (ch == '#') {
(*T)->rchild = NULL;
} else {
BiTree rightTree;
CreateBiTreeInorder(&rightTree);
(*T)->rchild = rightTree;
}
}
}