Stable sorting algorithms maintain the relative order of records with equal keys (i.e. values). That is, a sorting algorithm is stable if whenever there are two records R and S with the same key (i.e. value) and with R appearing before S' in the original list, R will appear before S' in the sorted list. Consider Insertion Sort, Merge Sort, Quick Sort. Which of these is not a stable sorting algorithm? Justify your answer.
Stable sorting algorithms maintain the relative order of records with equal keys (i.e. values). That is, a sorting algorithm is stable if whenever there are two records R and S with the same key (i.e. value) and with R appearing before S' in the original list, R will appear before S' in the sorted list. Consider Insertion Sort, Merge Sort, Quick Sort. Which of these is not a stable sorting algorithm? Justify your answer.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps