Algorithm to Insert a Node in Doubly Linked List