A、p->prior->next=p->next;p->next->prior=p->prior;free(p);
B、p->next= p->prior->next;p->prior= p->next->prior;free(p);
C、p->prior->next = p->next;p->next->prior = p->prior;
D、p->next= p->prior->next;p->prior= p->next->prior;
【正确答案】:A
【题目解析】:
在双链表上,链域prior和next分别指向本结点的直接前趋和直接后继。若p指向待删除的结点,则删除*p需要执行的操作如图2-3所示。具体操作步骤为:①p->prior->next=p->next;②p->next->prior=p->prior。