Home > Back-end >  DEV single-step tracking of the binary tree to create problems
DEV single-step tracking of the binary tree to create problems

Time:09-19

This is me to write a binary tree to create code, I want a single-step tracking the creation of a binary tree, why in the add view panel on * t tell me input errors??
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;
}


  • Related