建立一颗二叉树问题
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#define NULL 0
typedef struct BiTree{//二叉树存储结构
char data;
struct BiTree *lchild,*rchild;
}BiTree;
int CreateBiTree( BiTree *T ){//按先序输入二叉树
char ch;
scanf("%c",&ch);
if( ch == '#' ) T = NULL;
else {
if( !( T = ( BiTree * )malloc( sizeof( BiTree ) ) ) ) exit(-2);
T->data = ch;
CreateBiTree( T->lchild );
CreateBiTree( T->rchild );
}
return 1;
}
int main(){
BiTree *t;
CreateBiTree(t);
getch();
return 0;
}程序无法中止,谁帮忙看一下