Deleting All Occurrences of a Key in a Doubly Linked List
Deleting All Occurrences of a Key in a Doubly Linked List (DLL)
Introduction
A Doubly Linked List (DLL) is a data structure consisting of nodes, where each node contains three components:
- A data field
- A pointer to the next node
- A pointer to the previous node.
This structure allows traversal in both directions and efficient insertion and deletion operations.
Video Explanation

Problem Statement
Given a DLL and a key, the task is to delete all nodes that contain the specified key.
Example
Input:
DLL: 10 <-> 20 <-> 30 <-> 20 <-> 40 Key: 20
Output:
DLL: 10 <-> 30 <-> 40