Reorder a Linked List

medium
Unit 18 · Linked Lists0/3 to milestone

Reorder L0 → L1 → … → Ln into L0 → Ln → L1 → Ln-1 → L2 → … in place (re-linking nodes, not changing values) with O(1) extra space:

  1. find the middle with slow/fast pointers
  2. reverse the second half
  3. weave the two halves together
Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Reorder a Linked List · TechGradify