data structures using step if start null write underflow go to step [end of ifstep set ptr start step repeat steps and while ptr -next !null step set preptr ptr step set ptr ptr -next [end of loopstep set preptr -next null step free ptr step exit figure algorithm to delete the last node deleting the node after given node in linked list consider the 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 variables ptr and preptr which initially point to start start preptr ptr move preptr and ptr such that preptr points to the node containing val and ptr points to the succeeding node start preptr ptr preptr ptr start start preptr ptr set the next part of preptr to the next part of ptr start preptr ptr start figure deleting the node after given node in linked list figure shows the algorithm to delete the node after given node from 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 in the while loopwe take another pointer variable preptr such that it always points to one node before the ptr once we reach the node containing val and the node succeeding itwe set the next pointer of the node containing val to the address contained in next field of the node succeeding it the memory of the node succeeding the given node is freed and returned back to the free pool