← ALL NOTES
Linked List

92. Reverse Linked List II

Reverse just the segment [left, right] in a single pass using head-insertion. Put prev on the node right before the segment, let start be the segment's first node (it ends up as the segment's tail),…

Loading…