Reverse a linked list
Turn every arrow around with three pointers and no extra memory.
Values1, 2, 3, 4, 5
Reverse the list 1 → 2 → 3 → 4 → 5. prev starts at null and curr at the head.
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub