Algorithms

Sorting algorithm

An algorithm that puts data in order. They're compared by speed, whether they're in place (no extra array), whether they're stable, whether they're adaptive (use existing order) and whether they sort by comparing.

Example

Sorting 1 million numbers with merge sort costs about 20 million steps; with bubble sort, about 500 billion.

Test yourself: Sorting algorithm

What makes a good sort

What can be sorted with a sorting algorithm?

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.