Java program to delete a new node from the beginning of the doubly linked list
In this program, we will create a doubly linked list and delete a node from the beginning of the list. If the list is empty, print the message "List is empty". If the list is not empty, we will make the head to point to next node in the list then; we will delete the first node.
Consider the above example, new was the head of the list. Make head to point to next node in the list. Now, node 1 will become the new head of the list thus, deleting node new.
a. display() will show all the nodes present in the list.
Original List: 1 2 3 4 5 Updated List: 2 3 4 5 Updated List: 3 4 5 Updated List: 4 5 Updated List: 5 Updated List: List is empty