题目内容

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;

Suppose that the sequence of n elements PUSH the stack is p1, p2, p3, ..., pn, and the output sequence is 1, 2, 3, ..., n, if p3 = 1, then the value of p1 is ( ).

A The value may be 2
B The value must be 2
C The value cannot be 2
D The value cannot be 3

答案查题题库