Stable Sort

noun

say it: “STAY-bul sort” /ˈsteɪbəl sɔːrt/

A sort that keeps items that tie in the order they were in before the sort.

What is a stable sort?

A stable sort keeps items that tie in the order they were in before. Sort songs listed A to Z by plays with a stable sort, and songs with the same plays stay A to Z. Merge sort, insertion sort and the built-in sorts of Java (for objects), Python and JavaScript are stable; C#'s List<T>.Sort is not.

In a sentence

  • “With a stable sort, the songs with 340 plays stayed in their A to Z order.”

Level: Journeyman · More Data Structures terms at this level

Updated