3. Basic data structure and algorithms in java -Stability in sorting algorithms

What is stable sorting algorithm?

A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in the sorted output as they appear in the unsorted input.

Whereas a sorting algorithm is said to be unstable if there are two or more objects with equal keys which don’t appear in same order before and after sorting.
3. Basic data structure and algorithms in java -Stability in sorting algorithms
Bubble Sort, Insertion Sort, Merge Sort, Count Sort are stable, while Quick Sort, Heap Sort are not stable