久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      鏈表的c語言實現(xiàn)(八)

      2、插入
      對于雙向循環(huán)鏈表,我們現(xiàn)在可以隨意地在某已知結(jié)點p前或者p后插入一個新的結(jié)點。
      假若s,p,q是連續(xù)三個結(jié)點的指針,若我們要在p前插入一個新結(jié)點r,則只需把s的右鏈域指針指向r,r的左鏈域指針指向s,r的右鏈域指針指向p,p的左鏈域指針指向r即可。
      在p,q之間插入原理也一樣。
      下面就是一個應(yīng)用雙向循環(huán)鏈表插入算法的例子:
      #include <stdio.h>
      #include <malloc.h>
      #include <string.h>
      #define N 10

      typedef struct node
      {
      char name[20];
      struct node *llink,*rlink;
      }stud;

      stud * creat(int n)
      {
      stud *p,*h,*s;
      int i;
      if((h=(stud *)malloc(sizeof(stud)))==NULL)
      {
      printf(“不能分配內(nèi)存空間!”);
      exit(0);
      }
      h->name[0]=’