第31852题 单选题
在非空双向链表中,若要在指针p所指结点的后方插入指针s所指的新结点,下列操作序列正确的是?

假设双向链表的结点结构包含prior(指向前驱结点)和next(指向后继结点)两个指针域。

A

p->next = s; s->prior = p; s->next = p->next; p->next->prior = s;

B

s->next = p->next; p->next->prior = s; p->next = s; s->prior = p;

C

s->prior = p; s->next = p->next; if(p->next != NULL) p->next->prior = s; p->next = s;

D

s->prior = p; p->next = s; s->next = p->next; if(p->next != NULL) p->next->prior = s;

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析