A doubly linked list builds upon the mechanics of a singly linked list but offers enhanced capabilities. Each node in a doubly linked list contains three components:
- The data or value.
- A reference to the next node in the sequence.
- A reference to the previous node, allowing backward movement.
This bidirectional traversal is a significant advantage as it allows easy navigation in both directions,
making it efficient for operations that require frequent insertion or deletion of nodes.
While this offers more flexibility, it also requires more memory to store the additional reference.
The doubly linked list starts with a "head" node, whose previous reference points to null, and ends with a node whose next reference is null, highlighting the start and end of the list.