【数据结构】周末作业

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;

相关推荐
GoWjw16 小时前
内存管理【3】
linux·服务器·c++·ubuntu
shizhan_cloud16 小时前
Shell 变量进阶知识
linux·运维
liulilittle16 小时前
C++ 并发双阶段队列设计原理与实现
linux·开发语言·c++·windows·算法·线程·并发
YFLICKERH17 小时前
【Linux系统】磁盘文件系统
linux
森G17 小时前
五、Linux字符设备驱动
linux·arm开发·c++·ubuntu
生信大表哥17 小时前
Claude Code / Gemini CLI / Codex CLI 安装大全(Linux 服务器版)
linux·python·ai·r语言·数信院生信服务器
知识分享小能手17 小时前
CentOS Stream 9入门学习教程,从入门到精通, Linux文本编辑器 —— 语法详解与实战案例(5)
linux·学习·centos
Jasmine_llq17 小时前
《P3811 【模板】模意义下的乘法逆元》
数据结构·算法·线性求逆元算法·递推求模逆元
虹科网络安全17 小时前
艾体宝干货 | Redis Java 开发系列#2 数据结构
java·数据结构·redis
网安老伯17 小时前
什么是网络安全?网络安全包括哪几个方面?学完能做一名黑客吗?
linux·数据库·python·web安全·网络安全·php·xss