The problem of inserting nodes with two pointer fields in a doubly linked list (data structure)


There are two pointer fields in the doubly linked list, llink and rlink, which point back to the predecessor and the successor respectively. Let p point to a node in the linked list and q point to a node to be inserted. Now it is required to insert q before p, then insert it correctly for
This question is translated from Chinese

Source: Windows Questions C++