【数据结构】周末作业

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;

相关推荐
三言老师4 小时前
K8s集群运行时自动化运维全覆盖落地实操(下)
linux·运维·服务器·网络
ltl5 小时前
HAProxy HTX 与 HTTP 路径:内部表示、改写落点与协议分叉
linux
ltl5 小时前
可拆分 OS:CXL 内存池化如何动摇本地 DRAM 假设
linux
ltl5 小时前
Tetragon 强制执行:Override 与 SIGKILL 各自保证什么
linux
lengjingzju6 小时前
编译与调试完全指南—第6章 性能分析工具
linux
躺不平的理查德7 小时前
嵌入式 Linux 系统移植与 SD 卡量产镜像制作
linux·运维·服务器
Mr.亮先生7 小时前
# 把 DeepSeek 官方 Agent 工作台,直接装进 Windows 启动器里
windows·deepseek·harness
一直走下去-明8 小时前
centos7无法安装tcpreplay
linux·运维
疯狂打码的少年8 小时前
【数据结构】图的存储结构:邻接矩阵与邻接表
数据结构·笔记
吹什么轩8 小时前
linux网络:TCP套接字基础
linux·网络·tcp/ip