題組內容

4. The doubly linked list (DLlist) has the advantage of traversing in both forward and
backward directions. Thus we can define each node in DLlist as follows. It has two
link fields, one for forward direction and the other for backward direction.


(a) Assume that we want to add a new node between two nodes, anode and bnode, in
DLlist. Draw a figure to show this insertion. Note that you should label the
affected fields so that you show how each step in the insertion function is
executed (eg., newnode->llink, newnode->rlink, etc.). (10%)