MCPcopy Create free account
hub / github.com/142vip/408CSFamily / DeLoopQueue

Function DeLoopQueue

code/ds/LoopQueue.cpp:31–39  ·  view source on GitHub ↗

出队算法 头结点删除:x=Q.data[Q.front];Q.front=(Q.front +1)%Maxsize;Q.tag=0 队满条件:Q.front == Q.rear且Q.tag=1 注意:当删除之后链表为空时,还需增加一步,将尾指针指向头结点

Source from the content-addressed store, hash-verified

29// 队满条件:Q.front == Q.rear且Q.tag=1
30// 注意:当删除之后链表为空时,还需增加一步,将尾指针指向头结点
31int DeLoopQueue(SqQueue &Q, ElemType &x){
32 if (Q.front==Q.rear&&Q.tag==0){
33 return 0;
34 }
35 x=Q.data[Q.front];
36 Q.front=(Q.front+1)%MaxSize;
37 Q.tag=0;
38 return 1;
39}
40
41
42

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected