A.2n+2 B.n+1 C.n-1 D.2n-2
A.ph=p;p->next=ph B.p->next=Ph;p=ph C.p->next=ph->next;ph=p D.p->next=ph->next;ph->next=p
A.p=p->next B.q=p->next;q=q->next C.p->next = p->next->next D.q=p->next;p=p->next;q=p->next