单项选择题

双向链表中有两个指针域,即prior和next,分别指向前驱及后继,设p指向链表中的一个结点,q指向一个待插入结点,现要求在p前插入q,则正确的插入为( )。

A.p一>prior=q;q一>next=p;p一>prior一>next=q;q一>prior=p一>prior;
B.q一>prior=p一>prior;p一>prior一>nextpq;q一>next=p;p一>prior=q;
C.q一>next=p;p一>next=q;p一>prior一>next=q;q一>next=p;
D.p一>prior一>next=q;q一>next=p;q一>prior=p一>prior;p一>prior=q;
题目列表

你可能感兴趣的试题

微信扫码免费搜题