Hide Index
Doubly Linked List
0% completed
Introduction to doubly linked lists
Traversal in doubly linked lists
Insertion in doubly linked lists
- Understanding insertion at beginning
- Insert at beginning
- Understanding insertion at end
- Insert at end
- Understanding insertion after the given node
- Insert after the given node
- Understanding insertion before a given node
- Insert before the given node
- Understanding insertion at a given distance
- Insert at given distance
Deletion in doubly linked lists
- Understanding deletion of first node
- Delete first node
- Understanding deletion of last node
- Delete last node
- Understanding deletion by given data
- Delete node with given data
- Delete nodes with given data
- Understanding deletion after a given node
- Delete node after the given node
- Understanding deletion before a given node
- Delete node before the given node
- Understanding deletion of the given node
- Delete the given node
- Understanding deletion at a given distance
- Delete node at given distance
Pattern: Reversal
Pattern: Reversal (Subproblem)
Pattern: Two pointers
Pattern: Reorder
Assessments
Certificate
Identifying the two pointer pattern
Almost all two-pointer array problems can be formulated as doubly linked list problems and solved similarly using the two-pointer technique. These are generally medium or hard problems, as implementing the two-pointer solution for a doubly linked list is more cumbersome as we must deal with pointers and do null checks.
If the problem statement or its solution follows the generic template below, it can be solved by using the two-pointer technique.
Template
Given a doubly linked list, perform some operations on two nodes
Given a doubly linked list, perform some operations on two nodes
left and right and where left starts at x and right starts at y such that x < y and with each iteration left and right come closer to each other by some steps.Example
Liking the course? Check our discounted plans to continue learning.