mirror of
https://github.com/CodePanda66/CSPostgraduate-408.git
synced 2023-05-21 21:49:33 +08:00
🚩 finish SqQueue
This commit is contained in:
@@ -51,11 +51,11 @@ bool GetHead(SqQueue Q,int &x){
|
||||
//打印整个队列
|
||||
void PrintQueue(SqQueue Q){
|
||||
printf("开始打印队列\n");
|
||||
while(Q.front==Q.rear){
|
||||
|
||||
printf("Q[%d]=%d",Q.front,Q.data[Q.front]);
|
||||
while(Q.front!=Q.rear){
|
||||
printf("Q[%d]=%d\n",Q.front,Q.data[Q.front]);
|
||||
Q.front=(Q.front+1)%MaxSize;
|
||||
}
|
||||
printf("打印完毕!\n");
|
||||
}
|
||||
|
||||
//测试
|
||||
@@ -81,8 +81,6 @@ void TestQueue(){
|
||||
printf("出队失败了,再检出一下吧!\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
printf("结束测试!\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user