【数据结构】周末作业

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;

相关推荐
softshow10261 分钟前
使用 Windows 子系统 WSL 安装 Ubuntu 22.04
linux·windows·ubuntu
wadesir2 分钟前
简易制作LinuxShell完全指南(深入解析原理、设计与实践步骤)
linux·运维·服务器
水天需0101 小时前
HISTFILE 介绍
linux
L1624761 小时前
Windows 系统下 ZIP安装MySQL 详细操作步骤
数据库·windows·mysql
CreasyChan1 小时前
VirtualBox 安装 CentOS 7.2
linux·运维·centos
AAA.建材批发刘哥1 小时前
04--C++ 类和对象下篇
linux·c++·经验分享·青少年编程
我先测了1 小时前
零第三方工具!Win10 自带磁盘管理给 C 盘扩容「纯官方」操作笔记
windows·笔记·扩容·c盘扩容
杰克崔1 小时前
glibc社区提问
linux·运维·服务器·车载系统
山上三树2 小时前
MMU与页表
linux·嵌入式硬件
yueguangni2 小时前
centos7虚拟机nat模式连接不上xshell方法分享
linux·运维·服务器