Member-only story

Stable sorts

And why understanding the language around sorts is important

Steven Curtis
3 min readFeb 11, 2020

Sorting is really important in computing; imagine looking through your contacts list on your mobile phone while they do not have any particular order — let me tell you this would be an absolute nightmare.

Photo by Tim Gouw on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

Prerequisites:

  • Some awareness of sorting in your target language
  • Selection sort uses linear search, and although this is explained familiarity of it would help

Terminology

Documentation: Written text and/or diagrams that accompany computer software

Sorting: The process of arranging items systematically

Stable sort: A stable sorting algorithm preserves the original order of elements are that are equal when sorted

The issue

Imagine you are told from some documentation that a particular sorting algorithm “… is not guaranteed to be stable”.

You are being told something that is important, but are you aware of what you are being told and why this is vital to your software development journey?

An unstable sort

--

--

No responses yet