chap listsstacksand queues head curr tail figure doubly linked list class dlink private elementprivate dlink nextprivate dlink prev/doubly linked list node /value for this node /pointer to next node in list /pointer to previous node /constructors dlink( itdlink pdlink nelement itprev pnext ndlink(dlink pdlink nprev pnext ndlink next(return nextdlink setnext(dlink nextvalreturn next nextvaldlink prev(return prevdlink setprev(dlink prevvalreturn prev prevvale element(return elemente setelement( itreturn element it/class dlink figure doubly linked list node implementation with freelist access from list node to the next node and also to the preceding node on the list the doubly linked list node accomplishes this in the obvious way by storing two pointersone to the node following it (as in the singly linked list)and second pointer to the node preceding it the most common reason to use doubly linked list is because it is easier to implement than singly linked list while the code for the doubly linked implementation is little longer than for the singly linked versionit tends to be bit more "obviousin its intentionand so easier to implement and debug figure illustrates the doubly linked list concept like our singly linked list implementationthe doubly linked list implementation makes use of header node we also add tailer node to the end of the list the tailer is similar to the headerin that it is node that contains no valueand it always exists when the doubly linked list is initializedthe header and tailer nodes are created data member head points to the header nodeand tail points to the tailer node the purpose of these nodes is to simplify the insertappendand remove methods by eliminating all need for special-case code when the list is empty