单选题
对于线性链表,在p所指的结点后插入由q指向的新结点的语句序列是______。
A、
p->next=q; q->next=p->next;
B、
q=p->next; p->next=q;
C、
q->next=p->next; p->next=q;
D、
p=p->next; q->next=p;
【正确答案】
C
【答案解析】
在单链表中进行插入运算时需特别注意指针修改顺序。选项A的顺序是错误的。
提交答案
关闭