2024/2/25

这段代码展示了C语言中对序列数据的操作,涉及seqn数组的尾部指针移动、链表结构的插入和删除,以及内存管理。主要关注点是循环和链表的空检查。
摘要由CSDN通过智能技术生成

1.seqn[tail] = data;

   Tail = (tail+1)%SEQLEN;

2.data = seqn[head];

   Head = (head+1)%SEQLEN;

3.tail == head;

4.tail+1 == head;

5.while(head!=tail)

{head=(head+1)%SEQLEN;}

6.(tail-head+SEQLEN)%SEQLEN;

7.SEQLEN-1;

 

 

 

1.new=(struct list_head*)malloc(sizeof(struct list_head*));

   if(new==NULL)

    {

       printf("失败\n");

          return;

    }

new->next=prev->next;

prev->next=new;

      return;

2.struct list_head* p=prev->next;

   prev->next=p->next;

   p->next->prev=prev;

   free(temp);

   temp=NULL;

     return;

3.temp=(struct list_head*)malloc(sizeof(struct list_head*));

   if(temp==NULL)

    {

       printf("失败\n");

          return;

    }

      struct list_head* p=head;

      while(p->next!=NULL)

     {

         p=p->next;

     }

          Temp->next=NULL;

          p->next=temp;

          temp->prev=p;

          return;

4. entry->next->prev=entry->prev;

entry->prev->next=entry->next;

free(entry);

  entry=NULL;

return;

5. if(head->next==NULL)

    {

         printf("链表为空\n");

     }

       return;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值