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

乌兰浩特网站开发网页制作软件山水

乌兰浩特网站开发,网页制作软件山水,智慧工厂管理系统,江门网站推广策划双链表的增删查改 一.双向链表的初始化二.创建返回链表的头结点三.双向链表销毁四. 双向链表打印五.双向链表尾插六. 双向链表尾删七. 双向链表头插八.双向链表头删九.双向链表的查找十.双向链表在pos的前面进行插入十一. 双向链表删除pos位置的节点 一.双向链表的初始化 Lis… 双链表的增删查改 一.双向链表的初始化二.创建返回链表的头结点三.双向链表销毁四. 双向链表打印五.双向链表尾插六. 双向链表尾删七. 双向链表头插八.双向链表头删九.双向链表的查找十.双向链表在pos的前面进行插入十一. 双向链表删除pos位置的节点 一.双向链表的初始化 ListNode* LTInit() {ListNode* Phead ListCreate(-1);Phead-next Phead;Phead-prev Phead;return Phead; }二.创建返回链表的头结点 ListNode* ListCreate(LTDataType x) {ListNode* newnode (ListNode*)malloc(sizeof(ListNode));if (newnode NULL){perror(malloc fial);exit(-1);}newnode-data x;newnode-next NULL;newnode-prev NULL; } 三.双向链表销毁 void ListDestory(ListNode* pHead) {assert(pHead);ListNode* cur pHead-next;while (cur ! NULL){ListNode* next cur-next;free(cur);cur next;}free(pHead);//pHead NULL; }四. 双向链表打印 void ListPrint(ListNode* pHead) {assert(pHead);printf(哨兵位);ListNode* cur pHead-next;while (cur ! pHead){printf(%d , cur-data);cur cur-next;}printf(\n); }五.双向链表尾插 void ListPushBack(ListNode* pHead, LTDataType x) {ListNode* tail pHead-prev;ListNode* newnode ListCreate(x);newnode-prev tail;newnode-next pHead;pHead-prev newnode;tail-next newnode;}六. 双向链表尾删 void ListPopBack(ListNode* pHead) {assert(pHead);assert(pHead-next ! pHead);//ListNode* tail pHead-prev;//ListNode* tailprev tail-prev;//free(tail);//tailprev-next pHead;//pHead-prev tailprev;ListErase(pHead-prev); }七. 双向链表头插 void ListPushFront(ListNode* pHead, LTDataType x) {assert(pHead);ListNode* newnode ListCreate(x);newnode-next pHead-next;pHead-next-prev newnode;newnode-prev pHead;pHead-next newnode; }八.双向链表头删 void ListPopFront(ListNode* pHead) {assert(pHead);assert(pHead-next ! pHead);//ListNode* first pHead-next;//ListNode* second first-next;//pHead-next second;//second-prev pHead;//free(first);//first NULL;ListErase(pHead-next);}九.双向链表的查找 ListNode* ListFind(ListNode* pHead, LTDataType x) {ListNode* cur pHead-next;while (cur ! pHead){if (cur-data x){return cur;}cur cur-next;}return NULL; } 十.双向链表在pos的前面进行插入 void ListInsert(ListNode* pos, LTDataType x) {assert(pos);ListNode* posPrev pos-prev;ListNode* newnode ListCreate(x);posPrev-next newnode;newnode-prev posPrev;newnode-next pos;pos-prev newnode; }十一. 双向链表删除pos位置的节点 void ListErase(ListNode* pos) {assert(pos);ListNode* posNext pos-next;ListNode* posprev pos-prev;posprev-next posNext;posNext-prev posprev;free(pos);pos NULL;}
http://www.dnsts.com.cn/news/202225.html

相关文章:

  • 让别人访问自己做的网站学校html网站模板
  • 汕头网站排名推广vue怎么做网页
  • 龙岗优化网站建设qq企业邮箱格式
  • 武夷山景区网站建设优点电子商务网站开发的步骤
  • 网站宣传方式有哪些上海网站建设企业建站
  • 网站怎么做漂亮点wordpress调用会员等级
  • 免费金融网站模板电影网站logo设计
  • 网站建站时间查询中国市场调查网
  • .网站链接策略网站运营之怎样做好seo优化
  • 银行官方网站网站规划的原则
  • 孵化器网站建设1688关键词排名查询
  • 做网站的用户需求分析网站开发流程表
  • 聊城网站建设招聘佛山如何建立网站
  • 网站建设服务合同范本淘宝网页版登陆
  • 广州 网站 建设微电商平台
  • 广州最大网站建设梦幻西游官网
  • 网站代码有哪些免费签名logo设计
  • 摄影作品可以在哪些网站投稿海外购物app排行
  • 做盗版视频网站违法吗制作企业网站的流程
  • 石家庄网站seo外包网站排名logo怎么做
  • 北京网站开发设计如何用ps做网站导航
  • 网站开发如何无感更新给实体店老板做的网站
  • 企业展示网站建设上海人才信息网
  • 虚拟主机网站源码外贸通过哪些渠道找客户
  • 网站安装环境配置石家庄+外贸网站建设公司
  • 深圳企业网站建设标准做一个营销型网站需要多少钱
  • 呼伦贝尔建设网站二建报名时间2023年报名时间
  • 长春网站外包营销式网站建设
  • c 网站开发实战潍坊 logo设计公司
  • 淮安网站建设网站网速慢