struct node{
int data;
node* lchild;
node* rchild;
};
node* newnode(int v){ //新建结点
node* n=new node(v);
n->lchild=n->rchild=NULL;
return n;
}
void search(node* root,int x,int newx){ //查找 修改
if(root==NULL){
return ;
}
if(root->data==x){
root->data=newx;
}
search(root->lchild,x,newx);
search(root->rchild,x,newx);
return ;
}
void Insert(node* & root,int x){ //插入
if(root==NULL){
node* n=new node(x);
return ;
}
if() Insert(root->lchild,x);
else Insert(root->rchild,x);
}
node* Creat(int* a,int n){ //二叉树的建立
node* root=NULL;
for(int i=0;i<n;i++){
Insert(root,a[i]);
}
return root;
}