【数据结构】周末作业

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;

相关推荐
@卞12 小时前
ST 表相关练习题
数据结构·c++·算法
Linux技术芯12 小时前
金刚经修心课 你的生活指南
linux
Ace_317508877612 小时前
拼多多关键字搜索接口逆向:从 WebSocket 实时推送解析到商品数据结构化重建
数据结构·websocket·网络协议
天选之女wow13 小时前
【Hard——Day4】25.K 个一组翻转链表
数据结构·算法·leetcode·链表
Mr.H012713 小时前
多线程文件拷贝:从原理到实现的完整指南
linux·运维
曾经的三心草13 小时前
Java数据结构-List-栈-队列-二叉树-堆
java·数据结构·list
橘子真甜~14 小时前
C/C++ Linux网络编程5 - 网络IO模型与select解决客户端并发连接问题
linux·运维·服务器·c语言·开发语言·网络·c++
晚枫~14 小时前
不同浏览器在Windows和Mac上的跨域配置方法
windows·macos
oushaojun214 小时前
Linux内核KGDB进阶:源码级调试实战演练(转)
linux·运维·kgdb
船长㉿14 小时前
vim常用命令
linux·编辑器·vim