【数据结构】周末作业

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;

相关推荐
巴渝小禹42 分钟前
【Ubuntu】虚拟机 Ubuntu 挂载 宿主机 Windows文件夹
linux·ubuntu
洛克大航海3 小时前
解锁 PySpark SQL 的强大功能:有关 App Store 数据的端到端教程
linux·数据库·sql·pyspark sql
大海绵啤酒肚4 小时前
OpenStack虚拟化平台之T版搭建部署
linux·运维·云计算·openstack
gtr20205 小时前
Ubuntu24.04 最小化发布 需要删除的内容
linux
碎像5 小时前
Windows系统暂停强制更新的操作(超详细说明)
windows
jiayi_19995 小时前
Linux 容器安装 conda 和 pip
linux·conda·pip
一周困⁸天.6 小时前
Redis 主从复制
linux·redis
liebe1*16 小时前
C语言程序代码(四)
c语言·数据结构·算法
ayaya_mana6 小时前
CentOS 7/8/9 一键安装 Python 3.10+ 并配置默认版本
linux·python·centos
The Chosen One9856 小时前
【Linux】Linux权限讲解 :写给文件的一封情书
linux·运维·服务器