Which of the following sorting algorithms is not stable?

Practice Questions

Q1
Which of the following sorting algorithms is not stable?
  1. Bubble Sort
  2. Merge Sort
  3. Quick Sort
  4. Insertion Sort

Questions & Step-by-Step Solutions

Which of the following sorting algorithms is not stable?
  • Step 1: Understand what a sorting algorithm is. A sorting algorithm is a method for arranging elements in a list in a certain order (like ascending or descending).
  • Step 2: Learn about stability in sorting algorithms. A stable sorting algorithm maintains the relative order of equal elements (elements that are the same).
  • Step 3: Identify some common sorting algorithms. Examples include Bubble Sort, Merge Sort, Quick Sort, and Insertion Sort.
  • Step 4: Check which of these algorithms are stable. Bubble Sort, Merge Sort, and Insertion Sort are stable. Quick Sort is not stable.
  • Step 5: Understand why Quick Sort is not stable. During the sorting process, Quick Sort can rearrange equal elements, changing their original order.
No concepts available.
Soulshift Feedback ×

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

Not likely Very likely