题目内容

数组Q[n]用来表示一个循环队列,f为当前队列头元素的前一位置,r为队尾元素的位置,假定队列中元素的个数小于n,计算队列中元素个数的公式为:

A. r-f
B. (n+f-r)%n
C. n+f-r
D. (n+r-f)%n

查看答案
更多问题

判定一个队列QU(最多元素为m0)为满队列的条件:

A. QU->rear-QU->front==m0
B. QU->rear-QU->front-1==m0
C. QU->front==QU->rear
D. QU->front==QU->rear+1

以下程序段的输出结果是(队列中的元素类型QElem Type为char):void main( ){Queue Q; Init Queue (Q);Char x=’e’; y=’c’;EnQueue (Q,’h’); EnQueue (Q,’r’); EnQueue (Q, y);DeQueue (Q,x); EnQueue (Q,x);DeQueue (Q,x); EnQueue (Q,’a’);while(!QueueEmpty(Q)){ DeQueue (Q,y);printf(y);};Printf(x);}

A. stack
B. char
C. sackt
D. shtck

被限定为只能在表的一端进行插入操作,在表的另一端进行删除操作的是。

队列的插入操作、删除操作分别是在队列的、。

答案查题题库