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

米拓建站免费模板个人网页生成器

米拓建站免费模板,个人网页生成器,江苏建设集团有限公司网站,插画网站个人主页#xff1a;点我进入主页 专栏分类#xff1a;C语言初阶 C语言程序设计————KTV C语言小游戏 C语言进阶 C语言刷题 数据结构初阶 欢迎大家点赞#xff0c;评论#xff0c;收藏。 一起努力#xff0c;一起奔赴大厂。 目录 1.前言 2.带头双… 个人主页点我进入主页 专栏分类C语言初阶      C语言程序设计————KTV       C语言小游戏     C语言进阶 C语言刷题       数据结构初阶 欢迎大家点赞评论收藏。 一起努力一起奔赴大厂。 目录 1.前言 2.带头双向循环链表函数实现 3.总结 1.前言 在前面我们写过单链表循环链表的博客今天我主要给大家来带关于双向带头循环链表函数的功能与实现双向带头循环链表相对于单链表循环链表非常的容易实现他的函数的功能和 单链表循环链表一样如果你想要快速实现一个链表的所有功能带头双向循环链表非常的容易接下来让我们看看带头双向链表的奥妙把看完你绝对会佩服写出这种结构的人。 2.带头双向循环链表函数实现 #includestdio.h #includestdlib.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.hkea.cn/news/14572984/

相关文章:

  • wordpress按修改时间排序搜索引擎优化seo
  • 汉中市网站建设商标注册网上缴费流程
  • 工体商城网站建设门户网站建设投入
  • 青冈县网站建设wordpress应用商城wpjam
  • 网站外链建设分析重庆网站建设公司招聘
  • 做设计有哪些好用的素材网站网上推广企业
  • 标准网站建设服务器搭建创新平台
  • 网游开发成本seo网络营销推广优化
  • html旅游网站页面设计模板怎么拥有自己的小程序
  • 模板网站建设明细报价表WordPress星光主题
  • 什么网站做推广比较好两学一做网站无法做题
  • 网站建设seo推广洞头区小程序模板源代码
  • 金华市金东区建设局网站合肥营销网站建设公司
  • 微信网站和手机网站的区别电子商务网站建设实训目的
  • 网站建设百度推广总结中国海洋大学站群网站建设
  • 华为云速建站可以做英文网站跟公司产品做网站
  • 网站备案信息抽查运营好网站
  • 阿里云网站更换域名网站后台传照片 c windows temp 拒绝访问
  • 电子商务网站规划设计方案wordpress用户发表文章
  • 电销网站建设给企业做网站
  • 广安做网站公司14亿有多少中国人打了新冠疫苗
  • 传奇怎么做充值网站seo外包如何
  • 模型评测网站怎么做公司部门解散赔偿标准
  • 吉林省建设厅官方网站办事指南购物网站设计意义
  • 江苏省工程建设招标网站网页设计网站建设招聘
  • 饰品网站建设策划书搜索引擎google
  • 什么是交互式网站包头做网站
  • 沅江网站设计大型网站建设设备
  • 信息网站建设汇报展馆设计师招聘
  • 绵阳做网站优化高大上网站欣赏