在一个双链表中,在*p节点之前插入节点*q的操作是()。

9 查阅

在一个双链表中,在*p节点之前插入节点*q的操作是()。

A.p -> prior = q;q-> next=p;p -> prior ->next=q; q ->prior= p -> prior;

B.q ->prior= p -> prior;p -> prior ->next=q;q-> next=p;p -> prior = q->next;

C.q-> next=p;p -> next=q;q-> prior ->next= q;q-> next=p;

D.p -> prior ->next=q;q-> next=p;q -> prior = p->prior;p -> prior = q;

参考答案:

答案:p -> prior ->next=q;q-> next=p;q -> prior = p->prior;p -> prior = q;