2.23作业

2.23作业_第1张图片

1
new=(struct list_head*)malloc(sizeif(struct list_head));
prev->next=new;
new->next=next;
2
struct list head temp=(struct list_head*)malloc(sizeif(struct list_head));
temp=prev->next;
prev->next=next;
free(temp);
temp=NULL;
3
new=(struct list_head*)malloc(sizeif(struct list_head));
new->next=NULL;
head->next=new;
4//删最后一个
struct list head temp=(struct list_head*)malloc(sizeif(struct list_head));
temp=entry->next;
entry->next=NULL;
free(temp);
temp=NULL;
5
if(head->next==head->prev)
{
printf("空的");
return;
}

你可能感兴趣的:(linux,运维,服务器)