搜索树的建立与插入
struct node{
int data;
node *left,*right;
};
typedef struct node * tree;
tree insert(tree root,int data){
if(root==NULL){
root=new node;
root->data=data;
root->left=root->right=NULL;
return ;
}
if(data>root->data) insert(root->left,data);
else insert(root->right,data);
return root;
}