【数据结构】周末作业

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;

相关推荐
飞鸿踏雪(蓝屏选手)11 小时前
137 ≤ Chrome 主密钥获取研究
c++·chrome·windows·网络安全·逆向分析
Waay12 小时前
Linux Shell 知识点考评(一):grep 文本搜索(附答案)
linux·运维·服务器
jamon_tan12 小时前
Linux下串口RAW模式设置
linux
爱滑雪的码农12 小时前
Java基础十七:数据结构
数据结构
多加点辣也没关系12 小时前
数据结构与算法|第二十三章:高级数据结构
数据结构·算法
碧海银沙音频科技研究院12 小时前
基于VMware虚拟机ubuntu开发博通BK7258方法
linux·运维·ubuntu
孬甭_14 小时前
初识数据结构与算法
数据结构
阿虎儿14 小时前
[实战记录] Windows 11 远程桌面已开启,但 3389 端口无监听?终极排查与修复
windows
云边有个稻草人14 小时前
【Linux系统】进程地址空间
linux·虚拟地址空间·进程地址空间·虚拟地址空间是怎么实现的?·为什么要有虚拟地址空间?·怎么理解虚拟地址空间?