主题:求助一道队列的问题
执行下面函数调用后得到的输出结果是什么?
void AF(Queue & Q)
{
InitQueue(Q);
int a[4] = { 5,8,12,15 };
for ( int i=0; i<4; i++ ) QInsert(Q,a[i]);
QInsert(Q,QDelete(Q));
QInsert(Q,30);
QInsert(Q,QDelete(Q)+10);
while ( ! QueueEmpty(Q) ) cout <<QDelete(Q)<<’ ‘;
}
void AF(Queue & Q)
{
InitQueue(Q);
int a[4] = { 5,8,12,15 };
for ( int i=0; i<4; i++ ) QInsert(Q,a[i]);
QInsert(Q,QDelete(Q));
QInsert(Q,30);
QInsert(Q,QDelete(Q)+10);
while ( ! QueueEmpty(Q) ) cout <<QDelete(Q)<<’ ‘;
}