Algorithm to Insert a node in a doubly Linked list