题目内容

The circular queue with the maximum capacity of n, the tail pointer of the queue is rear, and the head pointer of the queue is front,the condition for queue empty is ( ).

A rear=front
B (rear+1) MOD n=front
C rear+1=front
D (rear-l) MOD n=front

查看答案
更多问题

Assuming that the elements of the circular queue are stored in the array A[m], and the head and tail pointers are front and rear respectively, the number of elements in the current queue is ( ).

A (rear-front+m)%m
B rear-front+1
C (front-rear+m)%m
D (rear-front+1)%m

The output of the following program is ( ) . int f( int x) { return (x>0)?x*f(x-1):2; } void main() { int i ; i = f(f(1)); printf("%d",i); }

A 4
B 2
C 8
D unlimited recursion

The input sequence of a stack is 1 2 3 4 5, then the following sequence cannot be the output sequence of the stack is ( ).

A 5 4 1 3 2
B 2 3 4 1 5
C 2 3 1 4 5
D 1 5 4 3 2

The input sequence of a stack is 1,2,3, ..., n, if the first element of the output sequence is i, then the output element j (1 <= j <= n) is ( ) .

A i-j+1
B i-j-1
C j-i+1
D Uncertain

答案查题题库