node *p, *q;

p->next = q;
q->prev = p;