data structures using deleting the node before given node in doubly linked list consider the doubly linked list shown in fig suppose we want to delete the node preceding the node with value before discussing the changes that will be done in the linked listlet us first look at the algorithm start take pointer variable ptr that points to the first node of the list start,ptr move ptr further till its data part is equal to the value before which the node has to be deleted ptr start delete the node preceding ptr ptr start start figure deleting node before given node in doubly linked list figure shows the algorithm to delete node before 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 linked list the while loop traverses through the linked list to reach the desired node once we reach the node containing valthe prev field of ptr is set to contain the address of the node preceding the node which comes before ptr the memory of the node preceding ptr is freed and returned to the free pool hencewe see that we can insert or delete node figure algorithm to delete node before given in constant number of operations given only that node node' address note that this is not possible in the case of singly linked list which requires the previous node' address also to perform the same operation 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 -prev step set temp -prev -next ptr step set ptr -prev temp -prev step free temp step exit programming example write program to create doubly linked list and perform insertions and deletions in all cases #include #include #include