【数据结构】周末作业

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;

相关推荐
想带你从多云到转晴9 分钟前
03、数据结构与算法--单向链表
java·数据结构·算法
vistaup10 分钟前
Windows 使用free-claude-code中转实现 claude code 调用 英伟达NVIDIA API
windows
美式请加冰20 分钟前
Linux权限的概念
linux·运维·服务器
两年半的个人练习生^_^26 分钟前
List集合的使用和源码
linux·windows·list
迈巴赫车主40 分钟前
蓝桥杯192.等差数列java
java·数据结构·算法·职场和发展·蓝桥杯
蓝天居士44 分钟前
认识libcurl(2)
linux·libcurl
武藤一雄1 小时前
WPF深度解析Behavior
windows·c#·.net·wpf·.netcore
老虎06271 小时前
数据结构09(Java)-- 二分查找模板
java·开发语言·数据结构
Rabitebla1 小时前
快速排序(QuickSort)完全指南 —— 从原理到工业级优化
c语言·数据结构·c++·算法·github
Jonathan Star1 小时前
在 Claude Code 中重新加载插件,最常用的是 **`/reload-plugins` 热重载**,也
linux·运维·服务器