Skip to content

Glossary: Data Structures and Algorithms in Rust

Stable sort

Also written: stable, sort_unstable

A sort that keeps equal items in their original order. Rust's sort, sort_by and sort_by_key are stable, while sort_unstable is usually a bit faster but may swap equal items.

Where the book teaches it

Related terms

Merge sortKey function