建立二叉树,中序输出,错哪了呢?运行不了,求指导。

建立二叉树,中序输出,哪里错了呢?运行不了,求指导。。。。。急
#include<stdio.h>
int x;
typedef struct node
{
int num;
node *lchild;
node *rchild;
}node;
void Create(node * Root)
{
if(!Root) 
{
Root->num=x;
node *p=new node;
node *q=new node;
p=q=NULL;
Root->lchild=p;
Root->rchild=q;
}
else
{
if(x<=Root->num) Create(Root->lchild);
else Create(Root->rchild);
}
}
void inorder(node * root)
{
if(root)
{
inorder(root->lchild);
printf("%d ",root->num);
inorder(root->rchild);
}
}
void main()
{
   int i;
   node *Root=new node;
   Root=NULL;
   for(i=0;i<7;i++)
   {
      scanf("%d",&x);
  Create(Root);
   }
   inorder(Root);
   delete Root;
}

------解决方案--------------------
if(!Root) 里面所有的 Root-> 都是未定义行为。
还有,这是要干吗?

node *Root=new node;
Root=NULL;


建议先在纸上写写算法,把逻辑搞正确了以后再写程序。
------解决方案--------------------
删除2茶树,要删掉所有节点。光是delete Root;肯定会内存泄露。
可以用NULL调用Create()函数,程序退出前释放所有内存。
void Create(node *&Root);
或者按照书上的:
typedef struct node
{
    int num;
    node *lchild;
    node *rchild;
}node,*tree;
void Create(tree &T);

删除所有节点的函数,类似后续遍历二叉树的算法