cs
//1
seqn[tail] = data;
tail = (tail+1)%SEQLEN;
//2
data = seqn[head];
head = (head+1)%SEQLEN;
//3
head = tail;
//4
(tail+1)%SEQLEN == head;
//5
while(head != tail)
{
tail--;
}
//6
(tail-head+SEQLEN)%SEQLEN;
//7
SEQLEN-1
cs
//1
new->next = next;
prev->next = new;
//2
struct list_head* new = prev->next;
prev->next = new->next;
free(new); new=NULL;
//3
struct list_head* p=head;
while(p->next != NULL)
{
p=p->next;
}
new->next = p->Next;
p->next = new;
//4
struct list_head* p = head;
while(p->next != entry && p->next != NULL)
{
p=p->next;
}
p->next = p->next->next;
free(entry); entry=NULL;
//5
if(head->next == NULL)
{
printf("队列为空\n");
return 1;
}
else
{
return 0;
}