Mental Model
A doubly linked list is a chain of nodes where each node knows its previous and next neighbor. To add a new node at the end, we link it after the last node and update pointers accordingly.
Analogy: Imagine a train where each carriage is connected to the one before and after it. Adding a new carriage at the end means hooking it to the last carriage and making sure both know about each other.
null β 1 β 2 β 3 -> null βhead βtail
