When designing a linked list, you can avoid all the special-cases (empty list, first node,
last node, etc) by using a sentry node. Let's see how that is done:
struct Node
{
Node* next;
Node* prev;
T data;
};
// helper function to link 2 nodes
void Link(Node* n1, Node* n2)
{
...