【数据结构】周末作业

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;

相关推荐
七七七七072 小时前
【计算机网络】深入理解ARP协议:工作原理、报文格式与安全防护
linux·服务器·网络·计算机网络·安全
lhxcc_fly6 小时前
Linux网络--8、NAT,代理,网络穿透
linux·服务器·网络·nat
摇滚侠6 小时前
Spring Boot3零基础教程,Spring Boot 应用打包成 exe 可执行文件,笔记91 笔记92 笔记93
linux·spring boot·笔记
yuanManGan6 小时前
走进Linux的世界:初识操作系统(Operator System)
android·linux·运维
Thexhy7 小时前
在 CentOS 7 的 Linux 系统中配置 NFS
linux·运维·学习·centos
咯哦哦哦哦7 小时前
linux vscode+cmake+clangd
linux·ide·vscode
lang201509287 小时前
如何在 Linux 中获取更多信息
linux·运维·服务器
DeBuggggggg7 小时前
linux 安装Python3.9 且支持SSL
linux·运维·ssl
我是标同学7 小时前
vmware17安装ubuntu2204版本qemu运行armv8处理器uboot运行调试(包括windows)的一些工作
linux·运维·服务器
杨云龙UP7 小时前
【MySQL迁移】MySQL数据库迁移实战(利用mysqldump从Windows 5.7迁至Linux 8.0)
linux·运维·数据库·mysql·mssql