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)