在下面的代码中
#include<iostream>
#include<cstring>
using namespace std;
class data
{
public:
long ddata;
data(long dd)
{
ddata=dd;
}
void display()
{
cout<<ddata<<" ";
}
};
class Node
{
const int order=4;
int numitems;
Node *parent;
Node *childarray[order];
data *item[order-1];
public:
void connect(int childnum,Node *child)
{
childarray[childnum]=child;
if(child!=NULL)
child->parent=this;
}
//disconetc from this node,return it;
Node *disconnectchild(int childnum)
{
Node *tempnode=childarray[childnum];
childarray[childnum]=NULL;
return (tempnode);
}
Node *getchild(int childnum){
return childarray[childnum];
}
Node *getparent()
{
return parent;
}
bool isleaf()
{
return (childarray[0]==NULL)?true:false;
}
int getnumitems()
{
return numitems;
}
data *getitem(int index)
{
return item[index];
}
bool isfull()
{
return (numitems==order-1)?true:false;
}
int finditem(long key)
{
for(int j=0;j<order-1;j++)
{
if(item[j]==NULL)
break;
else if(item[j]->ddata==key)
return j;
}
return -1;
}
int insertitem(data *newitem)
{
numitems++;
long newkey=newitem->ddata;
for(int j=order-2;j>=0;j--)
{
if(item[j]==NULL)
continue;
else
{
long itskey=item[j]->ddata;
if(newkey<itskey)
item[j+1]=item[j];
else
{
item[j+1]=newitem;
return j+1;
}
}
}
item[0]=newitem;
return 0;
}
data *removeitem()
{
data *temp=item[numitems-1];
item[numitems-1]=NULL;
numitems--;
return temp;
}
void displayNode()
{
for(int j=0;j<numitems;j++)
item[j]->display();
cout<<endl;
}
};
class tree234
{
private:
Node *root=new Node();
};
它说不允许数据成员初始化程序,Node root = new Node()它是java中的示例,我在root前面添加了星号,但还没有成功,请告诉我如何纠正它?