zoukankan      html  css  js  c++  java
  • 第十七次发博不知道用什么标题好

    双向链表的插入

    typedef struct node{

      Elemtype data;

      struct nide *prior;

      struct node *next;

    }Dlist;

    int insElem(Dlist *L,Elemtype x,int i){

      int j=0;

      Dlist *p,*s;

      *p=L;

      if(p==NULL) return 0;

      else {

          s=(Dlist *)malloc(sizeof(Dlist));

          s->data=x;  

          s->next=p->next;     //①

          if(p->next==NULL)

            p->next->prior=s;  //②

            s->prior=p;       //③

            p->next=s;       //④

            return 1;

        }

    }

  • 相关阅读:
    STM32-串口通信
    STM32-系统计时器(systick)
    字符串操作常用的函数
    基本MarkDown语法
    结构
    python入门
    贪心算法小结
    POJ1631_高深DP
    POJ3046ANT_COUNTING
    POJ1742coins
  • 原文地址:https://www.cnblogs.com/shi-yuan/p/10759960.html
Copyright © 2011-2022 走看看