#include "stdio.h"
#include "alloc.h"
#include "stdlib.h"
#include "stddef.h"
#define maxsize 100
typedef int datatype;
typedef struct node
{
datatype data;
struct node *lchild, *rchild;
}bitree;
bitree *q[maxsize];
bitree *creatree()
{
char ch;
int front,rear;
bitree *s,*root;
root=NULL;
front=1;
rear=0;
printf("please input a tree's string ended with#!\n");
ch=getchar();
while(ch!='#')
{ s=NULL;
if(ch!='@')
{s=malloc(sizeof(bitree));
s->data=ch;
s->lchild=s->rchild=NULL;
}
rear++;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载