AI engineering glossary · Data structures algorithms

What is stable sort?

Stable sort: A sorting method that keeps items with equal keys in the same relative order as in the input. This lets you sort by one field and then by another without losing the first ordering.

Level: intermediateTopic: Data structures algorithms

Stable sort: an example

Sort orders by date first, then stably by city: each city's orders stay in date order.

Related terms

More Data structures algorithms terms

Where you learn it

Stable sort is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.