假设以数组A[m]存放循环队列的元素,其头尾指针分别为front和rear,则当前队列中的元素个数为()。【北京工商大学 2001 一、2(3分)】
A. (rear-front+m)%m
B. rear-front+1
C. (front-rear+m)%m
D. (rear-front)%m
输入序列为ABC,可以变为CBA时,经过的栈操作为()【中山大学 1999 一、8(1分)】
A. push,pop,push,pop,push,pop
B. push,push,push,pop,pop,pop
C. push,push,pop,pop,push,pop
D. push,pop,push,push,pop,pop
最大容量为n的循环队列,队尾指针是rear,队头是front,则队空的条件是()。【南京理工大学 1999一、16(2分)】
A. (rear+1) % n=front
B. rear=front
C. rear+1=front
D. (rear-l)%n=front
若一个栈以向量V[1..n]存储,初始栈顶指针top为n+1,则下面x进栈的正确操作是()。【南京理工大学 1998 一、13(2分)】
A. top=top+1;V [top]=x
B. V [top]=x; top=top+1
C. top=top-1;V [top]=x
D. V [top]=x; top=top-1