/insert "itat current position public void insert( itcurr setnext(new dlink(itcurrcurr next()))curr next(next(setprev(curr next())cnt++public void append( it/append "itto list tail setprev(new dlink(ittail prev()tail))tail prev(prev(setnext(tail prev())cnt++/remove and return first element in right partition public remove(if (curr next(=tailreturn null/nothing to remove it curr next(element()/remember value curr next(next(setprev(curr)curr setnext(curr next(next())/remove from list cnt--/decrement the count return it/return value removed /move curr one step leftno change if at front public void prev(if (curr !head/can' back up from list head curr curr prev()figure implementations for doubly linked list class insertappendremoveand prev methods whether list implementation is doubly or singly linked should be hidden from the list class user figure shows the complete implementation for link class to be used with doubly linked lists this code is little longer than that for the singly linked list node implementation since the doubly linked list nodes have an extra data member figure shows the implementation for the insertappendremoveand prev doubly linked list methods the class declaration and the remaining member functions for the doubly linked list class are nearly identical to those of figures the insert method is especially simple for our doubly linked list implementationbecause most of the work is done by the node' constructor figure shows the list before and after insertion of node with value