Skip to content
core-pattern

In-Place Linked List Manipulation

Reverse, splice, partition, rotate, and delete linked-list nodes safely in place.

Problems

Problems in In-Place Linked List Manipulation

Practice problems that share this primary solution pattern and compare the clues that reveal it.

Group of high school students focused on learning in a computer lab setting.
beginner
10 min read

Merge Two Sorted Lists

The common failure mode here is treating linked lists like arrays: copy the values, sort them, and rebuild. That throws away the structure the problem…

View solution
A serene beach with soft sand, gentle waves, and lush green trees. Perfect for a nature escape.
intermediate
11 min read

Swap Nodes in Pairs

A value swap can produce the right sequence while violating the contract. The real task is to move node identities by changing links—and to do it without…

View solution
Close-up of a moss-covered tree trunk in a dark, moody forest setting.
intermediate
10 min read

Partition List

A linked-list partition fails in one of two ways: it loses the unread suffix, or it preserves a stale link and creates the wrong structure. The reliable…

View solution
Silhouette of a person walking on a vast sand dune in the desert at sunset in Huacachina, Peru.
intermediate
12 min read

Reverse Linked List II

A localized reversal fails at the boundaries: the middle looks correct, but the prefix disappears, the suffix becomes unreachable, or the returned head is…

View solution
Factory chimneys emitting smoke over rooftops on a clear day, illustrating urban pollution.
intermediate
11 min read

Rotate List

A right rotation looks repetitive when described one node at a time. The useful implementation is one split, one reconnection, and one cut.

View solution