Skip to content
StackDecode
Linked listsExplained

Merge Sort on Linked List

Split with slow/fast pointers, sort halves, merge.

Time

O(n log n)

Extra space

O(log n)

Use it for

The best sort for linked lists.

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.