Which of the following sorting algorithms is stable?

Practice Questions

Q1
Which of the following sorting algorithms is stable?
  1. Quick Sort
  2. Heap Sort
  3. Merge Sort
  4. Selection Sort

Questions & Step-by-Step Solutions

Which of the following sorting algorithms is stable?
  • Step 1: Understand what a stable sorting algorithm is. A stable sorting algorithm keeps the order of equal elements the same as they were in the original list.
  • Step 2: Look at the sorting algorithms provided in the question. Identify which ones are known to be stable.
  • Step 3: Recognize that Merge Sort is a sorting algorithm that is stable. It does not change the order of equal elements.
  • Step 4: Conclude that since Merge Sort maintains the relative order of equal elements, it is the stable sorting algorithm in the options given.
No concepts available.
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely