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.
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
- String matching
- Tabulation
- Time complexity
- Timsort
- Top-K problem
- Topological sort
- Traveling salesman problem
- Tree
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.