【数据结构】周末作业

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;

相关推荐
♞沉寂2 小时前
数据结构——双向链表
数据结构·算法·链表
大阳1232 小时前
数据结构2.(双向链表,循环链表及内核链表)
c语言·开发语言·数据结构·学习·算法·链表·嵌入式
掘根2 小时前
【Redis】string字符串
数据结构·数据库·redis
小孙姐2 小时前
Linux-Day12.DNS服务
linux·运维·服务器
小孙姐2 小时前
Linux-Day07.磁盘空间管理
linux·运维·服务器
鹿鸣天涯3 小时前
Kali Linux 2025.2基于MITRE ATT&CK框架
linux·运维·网络
杜子不疼.3 小时前
《Linux编译器:gcc/g++食用指南》
linux·服务器·开发语言
jie*3 小时前
小杰数据结构——题库——拂衣便欲沧海去,但许明月随吾身
数据结构·windows·python
专注VB编程开发20年5 小时前
用ADO操作EXCEL文件创建表格,删除表格CREATE TABLE,DROP TABLE
服务器·windows·excel·ado·创建表格·删除表格·读写xlsx