Delete a node in a Doubly Linked ListPre-requisite: Doubly Link List Set 1| Introduction and Insertion Show Write a function to delete a given node in a doubly-linked list. Delete middle of linked listGiven a singly linked list, delete the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the linked list should be modified to 1->2->4->5 If there are even nodes, then there would be two middle nodes, we need to delete the second middle element. For example, if given linked list is 1->2->3->4->5->6 then it should be modified to 1->2->3->5->6. If the input linked list has 1 node, then this node should be deleted and a new head should be returned. Singly Linked List vs Doubly Linked ListBefore looking at the differences between the singly linked list and doubly linked list, we first understand what is singly linked list and doubly linked list separately. About Linked ListLinked List is a one of the DataStructure used for storing collection of data. A Linked List has the following properties:
Basic Structure of Linked List- |