当前位置: 首页 > news >正文

关于网站开发中网站上传在网站里怎么做图片超链接

关于网站开发中网站上传,在网站里怎么做图片超链接,网站如何交换链接,广州网站设计费用个人主页:点我进入主页 专栏分类:C语言初阶 C语言程序设计————KTV C语言小游戏 C语言进阶 C语言刷题 数据结构初阶 欢迎大家点赞,评论,收藏。 一起努力,一起奔赴大厂。 目录 1.前言 2.带头双…

个人主页:点我进入主页

专栏分类:C语言初阶      C语言程序设计————KTV       C语言小游戏     C语言进阶

C语言刷题       数据结构初阶

欢迎大家点赞,评论,收藏。

一起努力,一起奔赴大厂。

目录

1.前言

2.带头双向循环链表函数实现

3.总结


1.前言

        在前面我们写过单链表,循环链表的博客,今天我主要给大家来带关于双向带头循环链表函数的功能与实现,双向带头循环链表相对于单链表,循环链表非常的容易实现,他的函数的功能和 单链表,循环链表一样,如果你想要快速实现一个链表的所有功能,带头双向循环链表非常的容易,接下来让我们看看带头双向链表的奥妙把,看完你绝对会佩服写出这种结构的人。

2.带头双向循环链表函数实现

#include<stdio.h>
#include<stdlib.h>
#include <assert.h>
typedef struct ListNode {int data;struct ListNode* prev, * next;
}ListNode;
ListNode* ListCreate(int x)
{ListNode* newnode = (ListNode*)malloc(sizeof(ListNode));if (newnode == NULL){perror("malloc");return NULL;}newnode->next = NULL;newnode->prev = NULL;newnode->data = x;return newnode;
}
ListNode* LInit()
{ListNode* head = ListCreate(-1);head->next = head;head->prev = head;return head;
}
void ListDestory(ListNode* phead)
{assert(phead);ListNode* cur = phead->next, * prev = phead;while (prev != phead){free(prev);prev = cur;cur = cur->next;}
}
void ListPrint(ListNode* phead)
{assert(phead);ListNode* cur = phead->next;printf("哨兵位<=>");while (cur != phead){printf("%d<=>", cur->data);cur = cur->next;}printf("\n");
}
void ListPushBack(ListNode* phead, int x){assert(phead);ListNode* newnode = ListCreate(x);ListNode* tail = phead->prev;tail->next = newnode;newnode->prev = tail;newnode->next = phead;phead->prev = newnode;
}
void ListPushFrount(ListNode* phead, int x)
{assert(phead);ListNode* newnode = ListCreate(x);ListNode* cur = phead->next;phead->next = newnode;newnode->prev = phead;newnode->next = cur;cur->prev = newnode;
}
void ListPopBack(ListNode* phead)
{assert(phead && phead->next != phead);ListNode* cur = phead->prev;cur->prev->next = phead;phead->prev = cur->prev;free(cur);
}
void ListPopFrount(ListNode* phead)
{assert(phead && phead->next != phead);ListNode* cur = phead->next;phead->next = cur->next;cur->next->prev = phead;free(cur);
}
ListNode* ListFind(ListNode* phead, int x)
{assert(phead);ListNode* cur = phead->next;while (cur->data != x){cur = cur->next;}return cur;
}
void ListInsert(ListNode* pos, int x)
{assert(pos);ListNode* newnode = ListCreate(x);ListNode* cur = pos->prev;cur->next = newnode;newnode->prev = cur;newnode->next = pos;pos->prev = newnode;
}
void ListErase(ListNode* pos)
{assert(pos);ListNode* cur = pos->next;ListNode* prev = pos->prev;free(pos);cur->prev = prev;prev->next = cur;
}
void text1()
{ListNode* head = LInit();ListPushBack(head, 1);ListPushBack(head, 2);ListPushBack(head, 3);ListPushBack(head, 4);ListPushBack(head, 5);ListPushFrount(head, 0);ListPrint(head);ListPopBack(head);ListPrint(head);ListPopBack(head);ListPrint(head);ListPopFrount(head);ListPrint(head);ListPopFrount(head);ListPrint(head);ListPushBack(head, 4);ListPushBack(head, 5);ListNode* cur = ListFind(head,3);ListPushFrount(head, 1);ListPushFrount(head, 0);	printf("%d\n", cur->data);ListPrint(head);ListInsert(head, 10);ListPrint(head);
}

3.总结

        带头双向循环的链表非常的好,接下俩我们对顺序表和链表的存储空间,随机访问,任意位置插入或删除元素,插入,缓存利用率,应用场景进行分析

不同点顺序表链表
存储空间上物理上一定连续逻辑上连续,但物理上不一定连
随机访问支持O(1)不支持:O(N)
任意位置插入或者删除元
可能需要搬移元素,效率低O(N)只需修改指针指向
插入动态顺序表,空间不够时需要扩
没有容量的概念
应用场景元素高效存储+频繁访问任意位置插入和删除频繁
缓存利用率

http://www.yayakq.cn/news/848413/

相关文章:

  • 网站设计提成多少钱设计图案
  • 网站开发蓝云企业网站建设公司郑州
  • 传奇免费网站模板下载网站建设好处
  • 国展做网站的公司没有文章更新的网站怎么做优化
  • 网站策划主要做什么工作山东网站开发网络公司
  • 如何拿高权重网站外链进行互换?wordpress 获取文章数量
  • 电子政务门户网站建设部署wordpress后访问空白页
  • 上海网站制作公司的排名简单好玩的网页游戏
  • 手机网站二级域名西安做小程序的公司
  • 网站优化平台有哪些天长街道两学一做网站
  • 房地产开发公司网站源码活动策划方案
  • 唐山石家庄做网站哪家好营销型网站建设网站
  • 电商的网站怎么做的怎样做音视频宣传网站
  • 重庆建新建设工程有限公司网站长春火车站在哪
  • 网站建设资讯英文手机商城网站建设
  • 导购网站 转化率做全景的h5网站
  • 内部网站 建设目标教育网站前置审批
  • wordpress打开最快的网站宣传片制作公司简介
  • 外贸企业网站推广品牌推广名词解释
  • 绍兴市住房和城乡建设局网站那些网站可以接私活做
  • 品牌网站建设方案ppt网站色调搭配
  • 凡科做网站有什么用泉州做网站便宜
  • 宁夏干部网络教育培训学院seo互联网营销培训
  • 网站搜索框设计怎么制作小程序卖东西
  • 建筑工具网站wordpress图片文件夹更换
  • 郑州网站建设项目制作链接的小程序
  • 网站首页外链荆门网站建设 金键盘
  • 邹城网站建设zczwxx企业网站建设的征求意见
  • 昆山网站建设苦瓜网络昆明seo技术培训
  • 怎么制作网站教程电商杭州定制软件开发