【数据结构】周末作业

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;

相关推荐
Better Bench1 小时前
WSL2 Ubuntu 中 Claude CLI “command not found” 故障排查与修复
linux·ubuntu·claude·wsl·claudecode
实心儿儿2 小时前
Linux —— 进程间关系和守护进程
linux·运维·服务器
Dawn-bit4 小时前
Linux磁盘管理详解
linux·运维·服务器·计算机网络·云计算
RisunJan4 小时前
Linux命令-sftp(SSH 文件传输协议客户端)
linux·运维
2501_936415694 小时前
可变参数&综合练习&斗地主游戏
java·windows·游戏
龙仔7256 小时前
人大金仓OS_Core数据库自动备份实施笔记(银河麒麟Linux)
linux·数据库·笔记·备份·人大金仓
老杨聊技术7 小时前
CentOS 7 安装 MySQL 8 保姆级教程
linux·mysql·centos
小poop7 小时前
轮转数组:从暴力到最优,一题掌握算法复杂度分析
数据结构·算法·leetcode
xiaoye-duck7 小时前
《Linux系统编程》Linux 系统多线程(六):<线程同步与互斥>线程同步(下):POSIX 信号量与环形队列生产者消费者模型详解
linux·线程
三言老师7 小时前
CentOS7.9:Redis‑Cluster集群部署结构化实战教程
linux·运维·服务器·数据库