【数据结构】周末作业

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;

相关推荐
leisoo80973 小时前
100GBA股股票数据怎么存ClickHouseRedisMySQLJSON完整对比
大数据·linux·服务器·开发语言·python
青瓦梦滋4 小时前
传输层UDP/TCP协议
linux·网络·c++·网络协议·tcp/ip·udp
ltl5 小时前
机密计算:SGX、SEV-SNP、TDX 与 ARM CCA
linux
ltl5 小时前
互联与网络:NVLink、InfiniBand、RoCE 与国产替代
linux
码上上班5 小时前
tengine知识点
linux·服务器·centos
LuminousCPP7 小时前
数据结构-双向循环链表
c语言·数据结构·笔记·链表
雾时之林7 小时前
Linux--软件管理、源码包安装
linux·服务器·数据库
白狐_7988 小时前
408数据结构第5章:树与二叉树②——遍历、线索树、森林与哈夫曼
数据结构·算法·深度优先
Jasmine_llq10 小时前
《P15800 [GESP202603 六级] 选数》
数据结构·long long·逆序线性 dp·从后往前推导·转移严格遵循题意·防止总和溢出·复杂度on
疯狂打码的少年10 小时前
【数据结构】串(字符串):基本概念与存储
数据结构·笔记