【数据结构】周末作业

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;

相关推荐
1000世界小札1 小时前
《大话数据结构》第9章精读:归并排序与快速排序完整 C++ 实现
数据结构·c++·算法
ltl5 小时前
QUIC 握手实现:Initial 到 1-RTT 的最小路径
linux
Android系统攻城狮7 小时前
Linux PipeWire深度解析之pw_init调用流程与实战(八十三)
linux·运维·服务器·音频进阶·pipewire音频进阶
M78佐菲8 小时前
Linux学习笔记:进程
linux·笔记·学习·算法
zbyyd9 小时前
Linux 进程管理详解:从概念到实战
linux·运维·服务器
薛定猫AI10 小时前
OpenAI Codex本地完整配置教程|(Windows/Mac/Linux全平台,修复鉴权报错)
linux·windows·macos
w01_02_0311 小时前
deepseek, harness , windows , 安装。
windows
辻弋20111 小时前
手动关服务会自动重启、组策略家庭版用不了——Windows Update Blocker用“禁用+锁定”双保险,让Win10/11自动更新彻底闭嘴
服务器·人工智能·windows·电脑·开源软件
躺不平的理查德11 小时前
OpenSSL 的异步 TLS 1.3 加密
linux·运维·服务器