【数据结构】周末作业

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;

相关推荐
程序员大辉14 分钟前
Win11精简版的天花板:Windows X-Lite 26H1 V3完整安装教程,老电脑也能装
windows·电脑
北顾笙98028 分钟前
day18-数据结构力扣
数据结构·算法·leetcode
luoqice33 分钟前
嵌入式linux用nfs挂载ubuntu目录的配置步骤
linux
我科绝伦(Huanhuan Zhou)39 分钟前
分享一个很实用的K8S巡检脚本
linux·docker·kubernetes
Net_Walke41 分钟前
【Ubuntu】共享文件夹 /mnt/hgfs 下不显示问题解决
linux·运维·ubuntu
熊明才1 小时前
PM2 服务器服务运维入门指南
运维·服务器·windows
charliejohn1 小时前
计算机考研 408 数据结构 排序算法
数据结构
CHANG_THE_WORLD1 小时前
PDFIUM如何处理宽度数组
java·linux·服务器
孙同学_1 小时前
【Linux篇】应用层自定义协议与序列化
linux·服务器·网络
沉迷学习 日益消瘦1 小时前
(windows环境)白嫖阿里云百炼免费 Token 使用 Claude 教程
windows·阿里云·claude·token·百炼