【数据结构】周末作业

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;

相关推荐
T0uken1 小时前
【Linux】SSH:简单端口转发的跳板机
linux·运维·ssh
dbkx_293 小时前
个人自用debian启动
linux·运维·debian
GalaxyPokemon4 小时前
归并排序:分治思想的高效排序
数据结构·算法·排序算法
dualven_in_csdn5 小时前
搞了两天的win7批处理脚本问题
java·linux·前端
晨曦backend6 小时前
Vim 匹配跳转与搜索命令完整学习笔记
linux·编辑器·vim
青小莫7 小时前
数据结构-C语言-链表OJ
c语言·数据结构·链表
bing_feilong7 小时前
Windows上SSH连接Ubuntu失败
windows·ubuntu·ssh
爬呀爬的水滴7 小时前
解决Ubuntu24.04版本,右键没有共享选项的问题
linux·服务器·ubuntu·samba·共享文件夹
IT coke8 小时前
centos7部署AWStats日志分析系统
linux·运维·centos
nenchoumi31198 小时前
UE5 学习系列(二)用户操作界面及介绍
windows·学习·ue5·机器人