阅读背景:

二叉树建立常用方式

来源:互联网 
void CreateTree(Btree *T)
{
    char a;
    cin>>a;
    if(a=='#')
    {
        T=NULL;
    }
    else
    {
        T=new Btree;
        T->data=a;
        CreateTree(T->left);
        CreateTree(T->right);
    }
}
/*
Btree* Create()
{
   Btree *t=NULL;
   char a;
   cin>>a; 
   if(a!='#')
   {
       t=new Btree;
       t->data=a;
       Btree->left=Create();
       Btree->right=Create();
   }
   return t;
}
*/

/*
Btree* Create(char s[100])
{
   Btree *t=NULL;
   if(a[i++]!='#')
   {
       t=new Btree;
       t->data=a[i];
       Btree->left=Create(s);
       Btree->right=Create(s);
   }
   return t;
}
*/void CreateTree(Btree *T)
{
    char a



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: