题目内容

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

In Double linked lists (nodes include: data, prior, next), when deleting the node pointed to by the pointer p,the operation is ( ).

A p->prior->next=p->next;p->next->prior=p->prior;
B p->prior=p->prior->prior;p->prior->next=p;
C p->next->prior=p;p->next=p->next->next;
D p->next=p->prior->prior;p->prior=p->next->next;

答案查题题库