合肥八中谢文波:麻烦帮我看看这个二叉树后序编历程序问题出在了哪?

来源:百度文库 编辑:高考问答 时间:2024/04/19 21:40:59
#include <stdio.h>
#include <stdlib.h>
#define telemtype char
#define null 0
#define MAXNODE 30
typedef struct bitnode {
telemtype data;
struct bitnode *lchild;
struct bitnode *rchild;
} bitnode,*bitree;/*连市存储结构*/
/******************/
typedef struct snode {
int flag;
bitree link;
} stacktype; /*栈结构*/
/***************/

bitnode * creatbitree() /*先序建立*/
{/*创建二叉树*/
char a;
bitree t;
a=getchar();
if(a=='#') t=null;
else
{
t=(bitree )malloc(sizeof(bitnode));
if(!t) printf("failure");
t->data=a;
t->lchild=creatbitree();
t->rchild=creatbitree();
}/*else*/
return t;
}
main()
{
bitree bt;
printf("input the bitreenode(先序):\n");
bt=creatbitree();
printf("\n后序输出:");
posttraverse(bt);
getche();
}

没有posttraverse()函数的源代码?

悬赏分可不可以多一点呀?