Algorithms

Stable sort

A sort that keeps the relative order of equal elements. It lets you sort by several criteria in a row.

Example

Students sorted by name: (A, 19), (D, 19). Sorting by age with a stable one, A stays before D.

Test yourself: Stable sort

What makes a good sort

A stable sort keeps the relative order of ___ elements.

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.