c语言,正在学二叉树的建立,编了一小段代码,求大神指导

在学二叉树的建立,根据自己的思路编了些代码,也不知道对不对。求大神,帮我看下这段代码是否能够成功建立一个二叉树.

#include
#include
typedef struct tnode Tnode;
struct tnode
{
Tnode *left;
Tnode *right;
int data;
};
Tnode *new_tnode(int data)
{
Tnode *new = malloc(sizeof(Tnode));
new->left=NULL;
new->right=NULL;
new->data=data;
return new;
}
void insert(Tnode *root,Tnode *tree)
{
if(root==NULL)
{
tree=root;
return;
}
if(root->datadata)
{
insert(root,tree->left);
}
else if(root->data>tree->data)
{
insert(root,tree->right);
}
}
int main()
{
Tnode *tree=NULL;
int i;
int data;
for(i=0;i<10;i++)
{
scanf("%d",data);
insert(new_tnode(data),tree);
}

return 0;

}

既然代码都有了测一下就知道是否正确了亲~

做个输出函数看一下图片说明

你上机试试呗~简单明了就知道能不能了

把程序放到编译器上去测试一下,加一个输出函数,然后你就可以知道有没有测试成功