【数据结构】周末作业

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;

相关推荐
LYFlied几秒前
【每日算法】LeetCode 300. 最长递增子序列
前端·数据结构·算法·leetcode·职场和发展
zhuzewennamoamtf3 分钟前
Linux Regmap API寄存器映射抽象化
linux·运维·服务器
Joker 0073 分钟前
Linux nohup命令实战指南
linux·运维·wpf
大聪明-PLUS5 分钟前
管理 Linux 内核模块
linux·嵌入式·arm·smarc
lifewange8 分钟前
关于进程的 Linux 命令有哪些?
linux·运维·服务器
三两肉15 分钟前
Linux 网络包的 “快递分拣”:从发送到接收的内核协作全景
linux·网络·计算机网络·tcp
非凡ghost24 分钟前
Floorp Browser(基于Firefox火狐浏览器)
前端·windows·学习·firefox·软件需求
Maguyusi1 小时前
pve lxc 虚拟机 raw 格式 磁盘 扩容
linux·运维·windows
建行一世1 小时前
【Windows笔记本大模型“傻瓜式”教程】在Dify的workflow中对接GPT_SoVITS实现对原神芙宁娜的语音生成
windows·gpt·ai
fpcc1 小时前
跟我学C++中级篇—Linux内核中链表分析
linux·c++·链表