?
Categories
Account

Which sorting algorithm is stable?

  • 📥 Instant PDF Download
  • ♾ Lifetime Access
  • 🛡 Secure & Original Content

What’s inside this PDF?

Question: Which sorting algorithm is stable?

Options:

  1. Quick Sort
  2. Heap Sort
  3. Merge Sort
  4. Selection Sort

Correct Answer: Merge Sort

Solution:

Merge Sort is a stable sorting algorithm, meaning it maintains the relative order of equal elements.

Which sorting algorithm is stable?

Practice Questions

Q1
Which sorting algorithm is stable?
  1. Quick Sort
  2. Heap Sort
  3. Merge Sort
  4. Selection Sort

Questions & Step-by-Step Solutions

Which sorting algorithm is stable?
  • Step 1: Understand what a sorting algorithm is. A sorting algorithm is a method used to arrange elements in a specific order, like ascending or descending.
  • Step 2: Learn about stability in sorting algorithms. A stable sorting algorithm keeps equal elements in the same order they appeared in the original list.
  • Step 3: Identify Merge Sort. Merge Sort is a specific type of sorting algorithm that divides the list into smaller parts, sorts them, and then merges them back together.
  • Step 4: Confirm that Merge Sort is stable. When Merge Sort combines the sorted parts, it preserves the order of equal elements, making it a stable sorting algorithm.
No concepts available.
Soulshift Feedback ×

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

Not likely Very likely
Home Practice Performance eBooks