1-1
所谓“循环队列”是指用单向循环链表或者循环数组表示的队列。 F
数组是错的
1-2
“Circular Queue” is defined to be a queue implemented by a circularly linked list or a circular array. F
循环队列”定义为循环链表或循环数组实现的队列
数组是错的
1-3
An algorithm to check for balancing symbols in an expression uses a queue to store the partial expression. F
检查表达式中平衡符号的算法使用队列(应为栈)来存储部分表达式
2-6
Following is the C-like pseudo code of a function that takes a Queue as an argument.
void foo(Queue Q)
{
Stack S = CreateStack(); // create an empty stack
while (!IsEmpty(Q))
{
// dequeue an item from Q and push it into S
Push(S, Dequeue(Q));
}
while (!IsEmpty(S))
{
// pop an item from S and enqueue it into Q
Enqueue(Q, Pop(S));
}
DisposeStack(S);
}
What does the above function do? D
A.Removes the last item from Q
B.Keeps Q unchanged
C.Makes Q empty
D.Reverses(反转) Q