Is merge sort stable? I read it in a book which says merge sort is stable as long as the merge operation implemented properly. Is that true?
Asked
Active
Viewed 1.8k times
7
-
read the wiki page... – Mitch Wheat Feb 23 '13 at 04:38
-
It's not an in place sorting algorithm, so perhaps by requiring a larger chunk of memory we can say it is as unstable as the memory it requires. – Rey Gonzales Feb 23 '13 at 04:38
-
@ReyGonzales I don't think that's what were talking about when we are assessing the stability of a sorting algorithm. And even then, most sorting algorithms that are not in place tend to be stable, such as merge sort. – Sal Rahman Nov 07 '16 at 06:06
1 Answers
8
true. It depends on how you properly implement the merge sort. http://en.wikipedia.org/wiki/Stable_sort#Stability

NinjaV
- 127
- 1
- 10