【数据结构】周末作业

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;

相关推荐
刚入门的大一新生8 分钟前
Linux-线程概念
linux·jvm
H.莓飛17 分钟前
【数据结构】排序总结与规模实测
linux·服务器·开发语言·数据结构·visual studio·1024程序员节
2501_9151063218 分钟前
Windows 上开发 Unity iOS,使用 KXBuild 进行真机调试、性能采样与打包 ipa
windows·vscode·unity·ios·个人开发·swift·敏捷流程
西柚不烦恼37 分钟前
Windows 本地部署私有 AI 全攻略:纯 CPU 环境(Ollama + Open WebUI)
人工智能·windows
少年的范儿43 分钟前
Windows 安装 Node.js 教程:nvm 版本管理 + pnpm 安装配置
windows·npm·node.js
Zenova EdgeOS44 分钟前
Linux 日志实战:用 journalctl 精准检索与治理工业边缘日志
linux·运维·chrome
Dxy12393102161 小时前
Linux 压缩解压相关命令介绍
linux·运维·服务器
eleven_4u1 小时前
QPS如何计算,如何部署架构
java·linux·运维·jvm·中间件
码少女1 小时前
数据结构——B+树基础
数据结构·b树
东城居士2 小时前
理解Linux RTC驱动
linux·嵌入式系统