题目内容

When recursive procedures or function calls, a data structure of ( ) is needed to process parameters and return addresses.

A Stack
B Queue
C Multidimensional Arrays
D Linear list

查看答案
更多问题

If an array of size 6 is used to implement a circular queue, and the current values of rear and front are 0 and 3 respectively, when one element is deleted from the queue and two more elements are added, the value of rear and front is ( ).

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

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

答案查题题库