我想用C++的风格来创建,但是测试了下不对,谁来提示下到底怎么回事啊?
代码先贴上:
struct node{
int data;
node *lchild,*rchild;
};
node *Create_tree()
{
int data = 0;
node *b = new node();
while(cin >> data)
{
b->data = data;
b->lchild = Create_tree();
b->rchild = Create_tree();
}
return b;
}