【数据结构】周末作业

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;

相关推荐
CheungChunChiu31 分钟前
Linux 内核动态打印机制详解
android·linux·服务器·前端·ubuntu
BlueBirdssh2 小时前
linux 内核通过 dts 设备树 配置pcie 控制器 各种参数和中断等, 那freeRTOS 是通过直接设置PCIe寄存器吗
linux
小目标一个亿2 小时前
Windows平台Nginx配置web账号密码验证
linux·前端·nginx
Aotman_2 小时前
Element-UI Message Box弹窗 使用$confirm方法自定义模版内容,修改默认样式
linux·运维·前端
玖釉-3 小时前
[Vulkan 学习之路] 08 - 给图片穿马甲:图像视图 (Image Views)
c++·windows·图形渲染
那些年的笔记4 小时前
Linux屏幕旋转方法
linux·运维·服务器
XiaoHu02074 小时前
Linux网络编程套接字
linux·服务器·网络·git
竹之却4 小时前
CentOS 系列,防火墙相关指令
linux·运维·centos
Ka1Yan5 小时前
[链表] - 代码随想录 707. 设计链表
数据结构·算法·链表
scx201310045 小时前
20260112树状数组总结
数据结构·c++·算法·树状数组