step if start null write underflow go to step [end of ifstep set ptr start step repeat step while ptr -next !null step set ptr ptr -next [end of loopstep set ptr -prev -next null step free ptr step exit figure algorithm to delete the last node figure shows the algorithm to delete the last node of doubly linked list in step we take pointer variable ptr and initialize it with start that isptr now points to the first node of the linked list the while loop traverses through the list to reach the last node once we reach the last nodewe can also access the second last node by taking its address from the prev field of the last node to delete the last nodewe simply have to set the next field of second last node to nullso that it now becomes the (newlast node of the linked list the memory of the previous last node is freed and returned to the free pool deleting the node after given node in doubly linked list consider the doubly linked list shown in fig suppose we want to delete the node that succeeds the node which contains data value then the following changes will be done in the linked list start take pointer variable ptr and make it point to the first node of the list start,ptr move ptr further so that its data part is equal to the value after which the node has to be inserted start delete the node succeeding ptr ptr start ptr start figure deleting the node after given node in doubly linked list step if start null write underflow go to step [end of ifstep set ptr start step repeat step while ptr -data !num step set ptr ptr -next [end of loopstep set temp ptr -next step set ptr -next temp -next step set temp -next -prev ptr step free temp step exit figure algorithm to delete node after given node figure shows the algorithm to delete node after given node of doubly linked list in step we take pointer variable ptr and initialize it with start that isptr now points to the first node of the doubly linked list the while loop traverses through the linked list to reach the given node once we reach the node containing valthe node succeeding it can be easily accessed by using the address stored in its next field the next field of the given node is set to contain the contents in the next field of the succeeding node finallythe memory of the node succeeding the given node is freed and returned to the free pool