第二题八个数字测试完成

This commit is contained in:
2024-10-24 00:31:27 +08:00
parent 9929d5d4eb
commit 368ee44fad
2 changed files with 21 additions and 3 deletions
+4 -3
View File
@@ -28,8 +28,8 @@ void enQueue(SeqQueue &q, int e) {
cout << "此队列已满" << endl;
return;
}
q.rear = (q.rear + 1) % MAX_SIZE;
q.data[q.rear] = e;
q.rear = (q.rear + 1) % MAX_SIZE;
}
int deQueue(SeqQueue &q) {
@@ -37,6 +37,7 @@ int deQueue(SeqQueue &q) {
cout << "此队列为空" << endl;
return NULL;
}
return q.data[q.front];
q.front(q.front - 1) % MAX_SIZE;
int returnE = q.data[q.front];
q.front = (q.front + 1) % MAX_SIZE;
return returnE;
}