Hide Index
- 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
- 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
Identifying the reorder pattern
The linked list problems that require reordering in place in the list are the only problems that can be solved using the reorder technique. These are generally medium problems where we split the list using some function and then merge them back together using another function. Many such problems also have smaller subproblems that require other techniques like reversal or fast and slow pointers to find the middle. If the problem statement or its solution follows the generic template below, it can be solved by applying the split list technique.
Given a linked list, reorder its nodes.
Example
Let's consider the following problem as an example to better understand how to identify and solve a problem using the reorder technique.
Liking the course? Check our discounted plans to continue learning.