#include<stdio.h>
#include<alloc.h>
#define keytype int
#define datatype char
typedef struct node
{
keytype key;
datatype vex;
struct node *lchild,*rchild;
}bstnode;
bstnode *INSERTBST(bstnode *t,bstnode *s)
{
bstnode *f,*p;
p=t;
while(p!=NULL)
{
f=p;
if(s->key==p->key)
return t;
if(s->key<p->key)
p=p->lchild;
else
p=p->rchild;
}
if(t==NULL)
return s;
if(s->key<f->key)
f->lchild=s;
else
f->rchild=s;
return t;
}
bstnode *CREATBST()
{
bstnode *s,*t;
keytype key,endflag=0;
datatype data;
t=NULL;
printf("intput a node key:");
scanf("%d",&key);
while(key!=endflag)
{
s=malloc(sizeof(bstnode));
s->lchild=s->rchild=NULL;
s->key=key;
printf("intput node's data:");
t=INSERTBST(t,s);
printf("intput last node key:");
scanf("%d",&key);
}
return t;
}
main()
{
bstnode *m;
bstnode *CREATBST();
m=bstnode *CREABST();
printf("%c",m);
}
帮我看这个二叉排序树程序错哪了!急!程序