start make start to point to the next node in sequence start figure deleting the first node of linked list figure shows the algorithm to delete the first node from linked list in step we check if the linked list exists or not if start nullthen it signifies that there are no nodes in the list and the control is transferred step if start null write underflow to the last statement of the algorithm go to step howeverif there are nodes in the linked listthen we use [end of ifstep set ptr start pointer variable ptr that is set to point to the first node of the list step set start start -next for thiswe initialize ptr with start that stores the address of step free ptr the first node of the list in step start is made to point to the step exit next node in sequence and finally the memory occupied by the figure algorithm to delete the first node pointed by ptr (initially the first node of the listis freed node and returned to the free pool deleting the last node from linked list consider the linked list shown in fig suppose we want to delete the last node from the linked listthen 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 ptr and preptr such that next part of ptr null preptr always points to the node just before the node pointed by ptr start set the next part of preptr node to null preptr ptr start figure deleting the last node of linked list figure shows the algorithm to delete the last 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 last node and the second last nodewe set the next pointer of the 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 back to the free pool