Algorithm For Doubly Linked List Operations