2,115 views

2 Answers

1 votes
1 votes

Any given sorting algo which is not stable can be modified to be stable. There can be sorting algo specific ways to make it stable, but in general, any comparison based sorting algorithm which is not stable by nature can be modified to be stable by changing the key comparison operation so that the comparison of two keys considers position as a factor for objects with equal keys.

Key comparison operation is always satisfies transitivity property. So, complexity of stable sort shouldnot increase more than a constant factor.

http://www.geeksforgeeks.org/stability-in-sorting-algorithms/

https://en.wikipedia.org/wiki/Sorting_algorithm#Stability

https://en.wikipedia.org/wiki/Comparison_sort

Related questions

0 votes
0 votes
2 answers
1
_Madhuri asked Oct 9, 2021
631 views
The complexity of comparison based sorting algorithm is (nlogn) .How?
0 votes
0 votes
0 answers
2
0 votes
0 votes
2 answers
3
rahul sharma 5 asked Dec 8, 2017
1,000 views
Which of the following sorting techniques have best time complexity, if complexity is measured in terms of number of comparison? A Insertion sortB Selection sortC Merge s...
1 votes
1 votes
2 answers
4
Jithin Jayan asked Jul 24, 2016
577 views
What is the Worst Case Space Complexity of Quick Sort?