请教一个关于2叉树输入的问题
#include<iostream>
using namespace std;
const int n=6;
class node
{
public:
char data;
node *llink,*rlink;
};
node tree[n+1];
node *initNode()
{
char ch;
node *first,*curret;
first=curret=new node;
int num,i=0;
cout<<"请输入要初始化的节点数:";
cin>>num;
while(i<num)
{
cout<<"请输入字符";
curret->data=ch;
}
}
void main()
{
node *start;
cout<<"初始化一棵数\n";
start=initNode();
}
左子树和右子数我想分别赋值,象链表一样的动态赋值,该怎么弄呢?请指教?