Or say should write other?? Please advise...
#include
#include
Typedef char elemtype;
Typedef struct Binode
{
Elemtype data;
Struct Binode * lchild;
Struct Binode * rchild;
} Binode;
Typedef Binode * Bitree;
Binode * CreatBitree Bitree (t)//sequence to create the tree before
{
Elemtype c;
The scanf (" % c ", & amp; C);
If (c=='#')
{
T=NULL;
Return t;
}
The else
{
T=(Bitree) malloc (sizeof (Binode));
T - & gt; data=https://bbs.csdn.net/topics/c;
T - & gt; Lchild=CreatBitree (t - & gt; Lchild);
T - & gt; Rchild=CreatBitree (t - & gt; Rchild);
}
Return t;
}
Void PreOrder Bitree (t)//PreOrder traversal
{
If (t==NULL)
return ;
Printf (" % c ", t - & gt; The data);
PreOrder (t - & gt; Lchild);
PreOrder (t - & gt; Rchild);
}
Int main ()
{
int a;
int b;
Bitree t;
Printf (" sequence input before you want to create a tree: ");
T=CreatBitree (t);
Printf (" creating success!" );
PreOrder (t);
return 0;
}