Understanding the reorder pattern
Some linked list problems require us to reorder the nodes of the given list in place based on some conditions. In most cases, this requires first splitting the list based on the outcome of some function f1 and then merging back the split list together either by using another function f2 or simply concatenating them. These are generally medium difficulty problems that require either the split or merge technique we learned earlier or both. Many such problems may also require using other techniques, such as the reversal or fast and slow pointer technique.
The reorder pattern is a classification of problems that require reordering the nodes of a linked list in place
Loading Image
Reordering nodes in a linked list is a combination of splitting and merging.
Liking the course? Check our discounted plans to continue learning.