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

网站自己维护wordpress 页脚链接

网站自己维护,wordpress 页脚链接,常熟企业网站建设,如何建设一个工业品采购网站#x1f307;个人主页#xff1a;平凡的小苏 #x1f4da;学习格言#xff1a;别人可以拷贝我的模式#xff0c;但不能拷贝我不断往前的激情 #x1f6f8;C语言专栏#xff1a;https://blog.csdn.net/vhhhbb/category_12174730.html #x1f680;数据结构专栏#xff… 个人主页平凡的小苏 学习格言别人可以拷贝我的模式但不能拷贝我不断往前的激情 C语言专栏https://blog.csdn.net/vhhhbb/category_12174730.html 数据结构专栏https://blog.csdn.net/vhhhbb/category_12211053.html         家人们更新不易你们的点赞和⭐关注⭐真的对我真重要各位路过的友友麻烦多多点赞关注欢迎你们的私信提问感谢你们的转发         关注我关注我关注我你们将会看到更多的优质内容 1、带头循环双向链表 我们在单链表中有了next指针这使得我们要查找下一节点的时间复杂度为O(1)。可是如果我们要查找的是上一节点的话那最坏的时间复杂度就是O(n)了因为我们每次都要从头开始遍历查找。 为了克服单向性这一缺点我们的老科学家们设计出了双向链表。双向链表是在单链表的每个结点中再设置一个指向其前驱结点的指针域。所以再双向链表中的结点都有两个指针域一个指向直接后继另一个指向直接前驱。 既然单链表可以有循环链表那么双向链表也可以有循环双向链表。如下图所示 2、双向循环链表函数接口的实现 2.1、双向循环链表的结构 typedef int LTDataType; typedef struct ListNode {LTDataType _data;//数据struct ListNode* _next;//后继指针struct ListNode* _prev;//前驱指针 }ListNode;2.2、初始化双向循环链表 ListNode* ListCreate() {ListNode* phead (ListNode*)malloc(sizeof(ListNode));if (phead NULL){perror(malloc Fail:);exit(-1);}phead-_next phead;phead-_data -1;phead-_prev phead;return phead; } 由于是带头循环链表我们需要malloc一个头节点出来当链表是空的时候前驱指针和后继指针都指向头结点。 2.3、双向循环链表的插入  // 创建返回链表的头结点. ListNode* BuyListNode(LTDataType x) {ListNode* newhead (ListNode*)malloc(sizeof(ListNode));if (newhead NULL){perror(malloc fail:);exit(-1);}newhead-_data x;newhead-_next NULL;newhead-_prev NULL;return newhead; } //双链表插入 void ListInsert(ListNode* pos, LTDataType x) {assert(pos);ListNode* newhead BuyListNode(x);//该函数是创建新节点的函数ListNode* Prev pos-_prev;Prev-_next newhead;newhead-_prev Prev;newhead-_next pos;pos-_prev newhead; } 注由于我们是在pos的前面插入一个结点那么我们就应该保存上一个结点。 插入算法的具体操作步骤         1.Prev-_next newhead;         2.newhead-_prev Prev;         3.newhead-_next pos;         4.pos-_prev newhead; 2.4、双向循环链表的删除操作 // 双向链表删除pos位置的节点 void ListErase(ListNode* pos) {assert(pos);//删除前pos不能为空assert(!ListEmpty(pos));//链表不为空才能删ListNode* ne pos-_next;//保存pos位置的后一个结点pos-_prev-_next ne;//删除结点的具体操作ne-_prev pos-_prev;free(pos);//释放 } 2.5、双向循环链表的判空 bool ListEmpty(ListNode* pHead) {assert(pHead);return pHead-_next pHead;如果头结点的下一个结点也等于头结点的话那么链表为空 } 2.6、双向循环链表的打印 // 双向链表打印 void ListPrint(ListNode* pHead) {assert(pHead);ListNode* cur pHead-_next;while (cur ! pHead){printf(%d , cur-_data);cur cur-_next;}printf(\n); } 2.7、双向循环链表的销毁 // 双向链表销毁 void ListDestory(ListNode* pHead) {assert(pHead);ListNode* cur pHead-_next;while (cur ! pHead)//链表要遍历释放{ListNode* ne cur-_next;free(cur);cur ne;}free(pHead);pHead NULL; } 3、源代码 由于头插、头删、尾插、尾删可以用双向循环链表的插入和删除操作复用这里直接放置源代码。 3.1、DList.c  #includeDSList.h // 创建返回链表的头结点. ListNode* BuyListNode(LTDataType x) {ListNode* newhead (ListNode*)malloc(sizeof(ListNode));if (newhead NULL){perror(malloc fail:);exit(-1);}newhead-_data x;newhead-_next NULL;newhead-_prev NULL;return newhead; } ListNode* ListCreate() {ListNode* phead (ListNode*)malloc(sizeof(ListNode));if (phead NULL){perror(malloc Fail:);exit(-1);}phead-_next phead;phead-_data -1;phead-_prev phead;return phead; } // 双向链表尾插 void ListPushBack(ListNode* pHead, LTDataType x) {assert(pHead);ListNode* newhead BuyListNode(x);ListNode* tail pHead-_prev;newhead-_prev tail;tail-_next newhead;newhead-_next pHead;pHead-_prev newhead;//ListInsert(pHead, x); } // 双向链表头插 void ListPushFront(ListNode* pHead, LTDataType x) {assert(pHead);ListNode* newhead BuyListNode(x);ListNode* first pHead-_next;newhead-_prev pHead;pHead-_next newhead;newhead-_next first;first-_prev newhead;//ListInsert(pHead-_next, x); } // 双向链表在pos的前面进行插入//判空 bool ListEmpty(ListNode* pHead) {assert(pHead);return pHead-_next pHead; } // 双向链表尾删 void ListPopBack(ListNode* pHead) {assert(pHead);assert(!ListEmpty(pHead));ListNode* tail pHead-_prev;ListNode* prevtail tail-_prev;prevtail-_next pHead;pHead-_prev prevtail;free(tail);//ListErase(pHead-_prev); } // 双向链表头删 void ListPopFront(ListNode* pHead) {assert(pHead);assert(!ListEmpty(pHead));ListNode* first pHead-_next;pHead-_next first-_next;first-_next-_prev pHead;free(first);//ListErase(pHead-_next); } //双链表插入 void ListInsert(ListNode* pos, LTDataType x) {assert(pos);ListNode* newhead BuyListNode(x);ListNode* Prev pos-_prev;Prev-_next newhead;newhead-_prev Prev;newhead-_next pos;pos-_prev newhead; } // 双向链表查找 ListNode* ListFind(ListNode* pHead, LTDataType x) {assert(pHead);ListNode* cur pHead-_next;while (cur ! pHead){if (cur-_data x){return cur;}cur cur-_next;}return NULL; } // 双向链表删除pos位置的节点 void ListErase(ListNode* pos) {assert(pos);assert(!ListEmpty(pos));ListNode* ne pos-_next;pos-_prev-_next ne;ne-_prev pos-_prev;free(pos); } // 双向链表打印 void ListPrint(ListNode* pHead) {assert(pHead);ListNode* cur pHead-_next;while (cur ! pHead){printf(%d , cur-_data);cur cur-_next;}printf(\n); } // 双向链表销毁 void ListDestory(ListNode* pHead) {assert(pHead);ListNode* cur pHead-_next;while (cur ! pHead){ListNode* ne cur-_next;free(cur);cur ne;}free(pHead);pHead NULL; } 3.2、DList.h #includestdio.h #includeassert.h #includestdbool.h #includestdlib.h // 带头双向循环链表增删查改实现 typedef int LTDataType; typedef struct ListNode {LTDataType _data;struct ListNode* _next;struct ListNode* _prev; }ListNode;// 创建返回链表的头结点. ListNode* ListCreate(); // 双向链表销毁 void ListDestory(ListNode* pHead); // 双向链表打印 void ListPrint(ListNode* pHead); // 双向链表尾插 void ListPushBack(ListNode* pHead, LTDataType x); // 双向链表尾删 void ListPopBack(ListNode* pHead); // 双向链表头插 void ListPushFront(ListNode* pHead, LTDataType x); // 双向链表头删 void ListPopFront(ListNode* pHead); // 双向链表查找 ListNode* ListFind(ListNode* pHead, LTDataType x); // 双向链表在pos的前面进行插入 void ListInsert(ListNode* pos, LTDataType x); // 双向链表删除pos位置的节点 void ListErase(ListNode* pos); //判空 bool ListEmpty(ListNode* pHead); 好了小编的分享到这里就结束了有什么不足的地方请大佬多多指教
http://www.w-s-a.com/news/875326/

相关文章:

  • 如何在电商上购物网站Wordpress 域名授权插件
  • 网站建设后台怎么弄昆明如何做好关键词推广
  • 自己怎么做个网站优酷视频网站开发
  • 2015做网站前景电子商务营销的发展现状
  • 官方网站建设情况说明电子商务网站开发的形式有
  • 网站建设玖金手指排名11专业建站公司建站系统
  • 全球排名前十网站百度网站官网网址
  • 商家在携程旅游网站怎样做宣传做网站公司苏州
  • 芜湖做网站都有哪些广州音乐制作公司
  • 青岛好的网站制作推广注册公司流程步骤
  • 怎么制作营销网站模板wordpress苗木模板
  • 手机网站样例wordpress 排序
  • 济南网站建设手机网站开发人员需要去做原型吗
  • 动易网站模板下载微信支付 wordpress
  • 学校建设外文网站情况阿里云 建设网站怎么样
  • 网站建设与网页设计制作深圳网站建设首选上榜网络
  • 网站浏览成交指标计算机应用是做什么的
  • 企业网站建设的要求wordpress 404页面模板
  • 公司怎么注册官方网站wordpress花园网站
  • 一般网站的建设步骤有哪些企业网站建设应该注意什么事项问题
  • 枣庄市建设局网站建设工程合同交底的内容包括
  • 全国十大跨境电商排名seo优化入门教程
  • 福安网站开发网站内容建设要求age06
  • 网站开发制作公司罗湖在线
  • 做网站银川潍坊网络科技有限公司
  • 南宁企业网站建站模板盐田高端网站建设
  • 深圳市建设局网站张局北京档案馆网站建设
  • 运动健身型网站开发网站备案掉了什么原因
  • 网站开发的前后端是什么注册网站多少钱一年
  • 彩票网站建设需要什么网站未备案被阻断怎么做