Design and implement an algorithm that performs insertions and deletions on a doubly linked list. In a doubly linked list each node has two pointers (except at the head and tail), one to its successor and one to its predecessor. (This allows for list traversal in both backward and forward directions.)