What is mean by stable sorting algorithm?

What is mean by stable sorting algorithm? Correct Answer A sorting algorithm is stable if it preserves the order of duplicate keys

Concept

The stability of a sorting algorithm is concerned with how the algorithm treats equal (or repeated) elements.

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

[ src="//storage.googleapis.com/tb-img/production/20/05/F1_R.S_21.5.20_Pallavi_D5.png" style="width: 566px; height: 162px;">

Some sorting algorithms are stable by nature like Insertion sort, Merge Sort, Bubble Sort, etc. And some sorting algorithms are not, like Heap Sort, Quick Sort, etc.

Related Questions

Statement 1: Shell sort is a stable sorting algorithm. Statement 2: Shell sort is an in-place sorting algorithm.
Introsort begins sorting the given array by using which of the following sorting algorithm?
Tim sort begins sorting the given array by using which of the following sorting algorithm?
which of the following is not a stable sorting algorithm in its typical implementation?
Which of the following sorting algorithm is stable?
Which of the following is not a stable sorting algorithm?
Which of the following sorting algorithm is NOT stable?