已知带头结点的链栈top,则元素x对应的新结点s进栈操作的语句是()

10 查阅

已知带头结点的链栈top,则元素x对应的新结点s进栈操作的语句是()

A.s->next=top->next;top->next=s;

B.top->next=s;s->next=top->next;

C.s->next=top;top=s;

D.top=s;s->next=top;

参考答案:

答案:s->next=top->next;top->next=s;