【数据结构】周末作业

1.new=(struct list_head*)malloc(sizeof(struct list_head*));

if(new==NULL)

{

printf("失败\n");

return;

}

new->next=prev->next;

prev->next=new;

return;

2.struct list_head* p=prev->next;

prev->next=p->next;

p->next->prev=prev;

free(temp);

temp=NULL;

return;

  1. struct list_head* temp = (struct list_head*)malloc(sizeof(struct list_head*));

if(temp==NULL)

{

printf("结点申请失败,插入失败\n");

return;

}

struct list_head* p=head;

while(p->next!=NULL)

{

p=p->next;

}

temp->next=NULL;

p->next=temp;

temp->prev=p;

return;

  1. entry->next->prev=entry->prev;

entry->prev->next=entry->next;

free(entry);

entry=NULL;

return;

  1. if(head->next==NULL)

{

printf("链表为空\n");

}

return;

相关推荐
平行云PVT5 小时前
数字孪生信创云渲染技术解析:从混合信创到全国产化架构
linux·unity·云原生·ue5·图形渲染·webgl·gpu算力
㓗冽5 小时前
8皇后·改-进阶题16
数据结构
xdscode6 小时前
Linux云服务器安装openclaw,并对接飞书通道
linux·服务器·飞书·openclaw
Percep_gan6 小时前
Linux中安装Redis,很详细
linux·运维·redis
2401_877274247 小时前
从匿名管道到 Master-Slave 进程池:Linux 进程间通信深度实践
linux·服务器·c++
月落归舟7 小时前
帮你从算法的角度来认识数组------( 二 )
数据结构·算法·数组
feng_you_ying_li7 小时前
linux之用户的权限详解(4)
linux·运维·服务器
vistaup8 小时前
windows git 更新当前目录下所有的文件(非递归)
windows·git
二进制person8 小时前
JavaEE初阶 --网络编程
linux·服务器·网络
Cyber4K8 小时前
【妙招系列】Harbor 镜像私有仓库搭建手册
linux·云原生·容器