/*二叉树-顺序*/
#include<stdio.h>
#define MAXSIZE 100
#define Telemtype int
#define Status void
typedef Telemtype sqbitree[MAXSIZE];
sqbitree bt;
/*构造一个二叉树,输入各结点的值的函数*/
Status createbitree(sqbitree *b)
{
int i,num;
printf("Input the bitree's node number: ");
scanf("%d",&num);
*b[0]=num;
printf("/nInput the the %d data: ",num);
for(i=1;i<=num;++i)
scanf("%d",b[i]); /*用0表示空树*/
}
/*遍历二叉树的函数*/
Status trave(sqbitree *b)
{
int i;
printf("The data of the bitree is:/n");
for(i=1;i<=*b[0];++i)
printf("%d ",*b[i]);
printf("/n");
}
void main()
{
createbitree(&bt);
trave(&bt);
}