Doubly Linked Lists
•
Given this, we know that insert will not
be as elegant as our LLL code:
–
//add as the first node:
–
node * temp = head;
–
head = new node;
–
head->data = new_data;
–
head->prev = NULL;
–
head->next = temp;
–
//anything else?