【数据结构】周末作业

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;

相关推荐
he___H8 分钟前
B、B+树和vue部分知识
数据结构·vue.js·b树
tealcwu22 分钟前
【Unity实战】Unity IAP 4.x 在 Windows Store (UWP) 平台上的实现指南
windows·unity·游戏引擎
用户23678298016836 分钟前
Linux iptables 深度解析:从规则匹配到 NAT 转发实战
linux
CairBin1 小时前
SideSail——Ubuntu 26.04(GNOME 50)侧边栏插件,支持设备信息剪贴板和米家设备简单控制
linux·ubuntu
howard20051 小时前
3.4 Linux目录操作
linux·目录操作
Volunteer Technology1 小时前
Flink的DataStream分区操作
大数据·linux·flink
hai3152475431 小时前
结构化编程:AI工业化编程的探索
数据结构·自然语言处理·硬件工程·动态规划·集成学习
爱讲故事的2 小时前
操作系统第四讲:OS Interfaces and Syscalls(操作系统接口与系统调用)
linux·windows·ubuntu
2401_868534782 小时前
2026年5月系统分析
数据结构·python·tornado
「QT(C++)开发工程师」2 小时前
免费在线 Ubuntu/Linux 运行环境
linux·运维·ubuntu