Algorithms

Insertion sort

A sorting algorithm that takes elements one at a time and inserts each into its place within the already sorted part, like arranging cards in your hand.

Example

With [7, 3, 5]: 3 goes before 7 → [3, 7], and 5 goes between them → [3, 5, 7].

Test yourself: Insertion sort

What is an algorithm

For what size of data does insertion sort work well?

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.