List Setup
Tip: Doubly Linked List supports forward and backward traversal with both 'prev' and 'next' pointers
Tip: Doubly Linked List supports forward and backward traversal with both 'prev' and 'next' pointers
Colors: Orange = Current Node, Green = Found/Success, Blue = New Node, Red = Deleted
\nNote: Each node in a doubly linked list has both 'prev' (backward) and 'next' (forward) pointers for bidirectional traversal.
Doubly Linked List is a linear data structure where elements are stored in nodes, and each node contains data, a pointer to the next node, and a pointer to the previous node.
Key Characteristics:
Why use Doubly Linked Lists?
Common Applications:
| Operation | Time Complexity | Space Complexity |
|---|---|---|
| Access | O(n) | O(1) |
| Search | O(n) | O(1) |
| Insert at Head | O(1) | O(1) |
| Insert at Position | O(n) | O(1) |
| Delete at Head | O(1) | O(1) |
| Delete at Position | O(n) | O(1) |
| Traversal | O(n) | O(1) |
Strengths:
Limitations: