Skip to content
StackDecode
Linked listsExplained

Reorder List

Interleave the first half with the reversed second half.

Time

O(n)

Extra space

O(1)

Use it for

L0→Ln→L1→Ln−1… pattern.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.