A doubly linked list node has two pointers: class DListNode: val: integer prev: DListNode or null next: DListNode or null The prev pointer enables backward traversal and simplifies deletion.
To delete a node when you only have a reference to that node: node.prev.next = node.next node.next.prev = node.prev Deletion runs in . No need to traverse from the head to find the predecessor.
The cost is extra memory (one more pointer per node) and more complex insertion/deletion code (you must update both directions).
Doubly linked lists are needed for implementing LRU caches. Time: . Space: .