【数据结构】周末作业

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;

相关推荐
oMcLin1 天前
Ubuntu 24.04系统 防火墙配置问题导致 MySQL 无法远程连接:firewalld 与 iptables 的冲突排查
linux·mysql·ubuntu
非凡ghost1 天前
U盘歌单管理器(适用于车载音乐U盘) 中文绿色版
前端·windows·学习·计算机外设·软件需求
qq_447429411 天前
Gemini CLI 非交互模式工具调用问题解析
windows·microsoft·交互
染指11101 天前
25.实现过TP保护ACE保护NP保护BE保护EAC保护-内存读写检测(私有句柄表和全局句柄表的句柄提权)-Windows驱动
windows·驱动开发·windows驱动·句柄提权
企鹅侠客1 天前
第07章—实战应用篇:List命令详解与实战(下)
windows·redis·log4j·list
wdfk_prog1 天前
[Linux]学习笔记系列 -- [fs]pidfs
linux·笔记·学习
Run_Teenage1 天前
Linux:自主Shell命令行解释器
linux·运维·服务器
一起养小猫1 天前
LeetCode100天Day9-无重复字符的最长子串与赎金信
java·开发语言·数据结构·leetcode
wdfk_prog1 天前
[Linux]学习笔记系列 -- [fs]pipe
linux·笔记·学习
white-persist1 天前
【内网运维】Netstat与Wireshark:内网运维溯源实战解析
运维·网络·数据结构·测试工具·算法·网络安全·wireshark