A doubly linked list is easy to follow once you understand how to use a pointer to access the previous node in the list. Here's a template, I'll explain as I go.
Code:
struct node {
int number;
node *next;
node *prev; //pointer to the previous node
}
int main() {
node root;
node iter;
root->next = NULL; //there's only one node so the root only
root->prev = NULL; //points to null both ways
root->number = 0;
iter = root;
for ( int i = 1; i < 10; i++ ) {
iter->next = new node; //new node, same as usual
iter->next->prev = iter; //new node points to current node with prev pointer
iter->next->next = NULL; //new node points to null with next pointer
iter = iter->next; //new node becomes current node
iter->number = i; //place the value of the counter in number
}
The only real difference is when you assign the iterator to the new node. You have to assign the prev pointer of the new node to the current node before making the new node the current node. Printing, inserting, and deleting are exactly the same except with an added step of dealing with the extra pointer to the previous node.