【数据结构】周末作业

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;

相关推荐
卷土重去26 分钟前
第 6 章 Linux 实操篇-Vi 和 Vim 编辑器
linux·编辑器·vim
sukalot2 小时前
windows 驱动实例分析系列: HidHide驱动分析-HidHideClient 篇(中)
windows·驱动开发
一个初入编程的小白2 小时前
数据结构:二叉树链式结构的实现
数据结构
en.en..3 小时前
Linux 孤儿进程与僵尸进程
linux·运维·服务器
T1mzhou8 小时前
ARM64 Linux 6.10内核启动流程7-ioremap和readl writel
linux·服务器·c语言
bwz999@88.com9 小时前
Ubuntu Server 24.04 设置中文
linux·运维·ubuntu
fly-979 小时前
Ubuntu FTP/SFTP 报错:找不到匹配的 hostkey 算法 完整解决
linux·ubuntu
雨落在了我的手上9 小时前
Java数据结构(十一):优先级队列(堆)
数据结构
Cx330❀9 小时前
【Linux网络】网络层协议 IP :从网络层原理到 Linux 内核源码
linux·运维·服务器·网络·tcp/ip·ai·ai编程
Gl�ria10 小时前
Linux 清理日志常用命令
linux·运维·服务器