Algorithms

Merge sort

A sorting algorithm that splits the list into halves, sorts them and merges them: O(n log n).

Example

Sorting 1 million items with merge sort takes about 20 million steps.

Test yourself: Merge sort

Merge sort

Merge sort stops splitting when pieces have ___ element.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.