- 论坛徽章:
- 0
|
int insert(int a1,int a2,node head,node end)
{
printf("*******the insert is %d %d ...\n",a1,a2);
node x;
x=malloc(sizeof(Node));
node p_before;
p_before=malloc(sizeof(Node));
node p2;
p2=malloc(sizeof(Node));
x->n1=a1;
x->n2=a2;
x->left1=NULL;
x->right1=NULL;
x->left2=NULL;
x->right2=NULL;
if(head->right1==NULL) //if it is the first one
{
head->right1=x;
x->left1=head;
end=x;
printf("head is %d %d\n",head->right1->n1,head->right1->n2);
printf("end is %d %d\n",end->n1,end->n2);
counter=1;
printf("the first one is %d %d \n",a1,a2);
}
……
return 0;
} |
|