【数据结构】周末作业

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;

相关推荐
big_rabbit050243 分钟前
[算法][力扣101]对称二叉树
数据结构·算法·leetcode
炸膛坦客1 小时前
Linux - Ubuntu - PC端:(三)切换中英文,Fcitx5
linux·ubuntu
7yewh1 小时前
jetson_yolo_deployment 01_linux_dev_env
linux·嵌入式硬件·yolo·机器人·嵌入式
cyber_两只龙宝1 小时前
【Haproxy】Haproxy的算法详解及配置
linux·运维·服务器·云原生·负载均衡·haproxy·调度算法
WolfGang0073211 小时前
代码随想录算法训练营 Day11 | 二叉树 part01
数据结构
美好的事情能不能发生在我身上1 小时前
Hot100中的:贪心专题
java·数据结构·算法
阿常呓语1 小时前
Linux命令 jq详解
linux·运维·shell·jq
君生我老2 小时前
Linux 权限
linux
hy____1232 小时前
Linux_网络基础3
linux·服务器·网络
我不听你讲话2 小时前
LNMP网络服务搭建
linux·php·apache