Regardless of the operation of the doubly linked list, you must pay great attention to the sequence problem, because each node has an additional precursor pointer, so a big error will occur if the sequence is wrong.
1. The insertion operation of the doubly linked list.
Code example:
s->next=p;
s->prior=p->prior;
p->prior->next=s;
p->prior=s;
2.
Code example of delete operation of doubly linked list;
p->prior->next=p->next;
p->next->prior=p->prior;
delete(p); //c语言使用free