DEV Community

Cover image for Stability in Sorting Algorithms
Harsh Bhardwaj
Harsh Bhardwaj

Posted on

Stability in Sorting Algorithms

**

Definition-

**
Stability in a sorting algorithm refers to the preservation of the relative order of records with equal values. Useful in Databases where secondary keys need to be stable.
Examples-

  1. Bubble Sort
  2. Merge Sort
  3. Insertion Sort

Difference between Stable and Unstable

Image description

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more