step if start null write underflow go to step [end of ifstep set ptr start step repeat step while ptr -next !start step set ptr ptr -next [end of loopstep set ptr -prev -next start step set start -prev ptr -prev step free ptr step exit figure algorithm to delete the last node figure shows the algorithm to delete the last node from circular 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 the second last node to contain the address of startso 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 programming example write program to create circular doubly linked list and perform insertions and deletions at the beginning and end of the list #include #include #include struct node struct node *nextint datastruct node *prev}struct node *start nullstruct node *create_ll(struct node *)struct node *display(struct node *)struct node *insert_beg(struct node *)struct node *insert_end(struct node *)struct node *delete_beg(struct node *)struct node *delete_end(struct node *)struct node *delete_node(struct node *)struct node *delete_list(struct node *)int main(int optionclrscr()do printf("\ \ *****main menu *****")printf("\ create list")printf("\ display the list")printf("\ add node at the beginning")printf("\ add node at the end")printf("\ delete node from the beginning")printf("\ delete node from the end")printf("\ delete given node")printf("\ delete the entire list")printf("\ exit")printf("\ \ enter your option ")