單項選擇題在一個雙鏈表中,在*p節(jié)點之前插入節(jié)點*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;


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在一個雙鏈表中,在*p節(jié)點之后插入節(jié)點*q的操作是()。

A.q->prior =p;p->next=q;p ->next ->prior =q;q ->next =p ->next;
B.q ->next =p ->next;p ->next ->prior =q;p->next=q;q->prior =p;
C.p->next=q;q->prior =p;q ->next =p ->next;p ->next ->prior =q;
D.p ->next ->prior =q;q->prior =p;p->next=q;q ->next =p ->next;

2.單項選擇題在單鏈表中查找指定值的節(jié)點的時間復(fù)雜度是()。

A.O(log2n)
B.O(1)
C.O(n2
D.O(n)