【数据结构】周末作业

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;

相关推荐
ouynagda4 分钟前
嵌入式Linux i.MX6ULL系统移植学习笔记
linux·笔记·学习
NightReader9 分钟前
PVE 环境部署
linux
yi01110 分钟前
DAY22: LeetCode 733:图像渲染——从二维网格开始理解 DFS 和 BFS
数据结构·笔记·python·算法·leetcode·深度优先·宽度优先
蚰蜒螟16 分钟前
一次挂载的完整旅程:Linux 内核 VFS 到 ext4 的调用链剖析
linux·运维·服务器
天蓝蓝的本我33 分钟前
linux本地部署Qwen3.8 27B
linux·运维·excel
今夜有雨.1 小时前
图像运算、掩膜/ROI 与绘制交互
c语言·数据结构·c++·qt·算法·计算机视觉
lisanmengmeng1 小时前
NRPE 添加命令(四)
linux·运维·服务器
想做小南娘,发现自己是女生喵1 小时前
i.MX6ULL嵌入式Linux入门学习文档
linux·运维·学习
东木月1 小时前
Windows C 盘清理指南:安全删除临时文件、缓存与 Prefetch
c语言·windows·安全
垆边人似月.2 小时前
日志时间窗口内的最大并发请求数(100分 / 滑动窗口 + 排序)
数据结构·c++·算法