All Patterns
Pattern 6
In-place List Reversal
Reverse a linked list or sublist by re-wiring next pointers in-place using prev, current, next variables. No extra space needed.
Time
O(n)
Space
O(1)
Recognize it when
- Reverse entire linked list
- Reverse a sublist between positions m and n
- Reverse every k nodes
Progress0/4
0 solved0 attempted
Questions — ordered by difficulty
#206Easy
Reverse Linked List
Reverse a singly linked list in-place.
linked-list
#92Medium
Reverse Linked List II
Reverse the nodes of the list from position left to right in one pass.
linked-list
#25Hard
Reverse Nodes in k-Group
Reverse the nodes of a linked list k at a time. If remaining nodes are fewer than k, leave them as is.
linked-listrecursion
#61Medium
Rotate List
Rotate a linked list to the right by k places.
linked-list