C
Clarity News Hub

Which sorting method is stable?

Author

William Rodriguez

Published Jan 15, 2026

Several common sorting algorithms are stable by nature, such as Merge Sort, Timsort, Counting Sort, Insertion Sort, and Bubble Sort. Others such as Quicksort, Heapsort and Selection Sort are unstable.Several common sorting algorithms

sorting algorithms

Quicksort is a divide-and-conquer algorithm. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. For this reason, it is sometimes called partition-exchange sort.

› wiki › Quicksort

are stable by nature, such as Merge Sort

Merge Sort

In computer science, merge sort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the order of equal elements is the same in the input and output.

› wiki › Merge_sort

, Timsort, Counting Sort, Insertion Sort

Insertion Sort

Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.

› wiki › Insertion_sort

, and Bubble Sort. Others such as Quicksort, Heapsort and Selection Sort

Selection Sort

The time efficiency of selection sort is quadratic, so there are a number of sorting techniques which have better time complexity than selection sort. One thing which distinguishes selection sort from other sorting algorithms is that it makes the minimum possible number of swaps, n − 1 in the worst case.

› wiki › Selection_sort

are unstable.

Which sorting method is best?

Quicksort. Quicksort is one of the most efficient sorting algorithms, and this makes of it one of the most used as well. The first thing to do is to select a pivot number, this number will separate the data, on its left are the numbers smaller than it and the greater numbers on the right.

What is the sorting technique which is not stable?

Explanation: out of the given options selection sort is the only algorithm which is not stable. it is because the order of identical elements in sorted output may be different from input array.

Which sorting algorithm is stable Mcq?

Merge sort is a stable sorting algorithm.

Which sorting technique is stable and adaptive?

In other words, stable sorting maintains the position of two equals elements similar to one another. For example – Insertion Sort, Bubble Sort , and Radix Sort. By Adaptability : In a few sorting algorithms, the complexity changes based on pre-sorted input i.e. pre-sorted array of the input affects the running time.

17 related questions found

Is bucket sort stable?

Bucket sort is stable, if the underlying sort is also stable, as equal keys are inserted in order to each bucket. Counting sort works by determining how many integers are behind each integer in the input array A.

Which of the following stable sorting algorithm takes the least time?

7. Which of the following stable sorting algorithm takes the least time when applied to an almost sorted array? Explanation: Sorting a partially sorted array with insertion sort takes linear time. Merge sort is stable, even though merge and fast sort have O(n*logn) complexity.

Which of the following is a stable sorting algorithm in its typical implementation?

Several common sorting algorithms are stable by nature, such as Merge Sort, Timsort, Counting Sort, Insertion Sort, and Bubble Sort. Others such as Quicksort, Heapsort and Selection Sort are unstable.

What is stable sorting method in DAA?

A sorting algorithm is said to be stable if two objects with equal keys appear in the same order in sorted output as they appear in the input array to be sorted.

What is stable sorting algorithm with example?

Some examples of stable algorithms are Merge Sort, Insertion Sort, Bubble Sort and Binary Tree Sort. While, QuickSort, Heap Sort, and Selection sort are the unstable sorting algorithm. If you remember, Collections. sort() method from Java Collection framework uses iterative merge sort which is a stable algorithm.

Which sorting method is fastest?

But since it has the upper hand in the average cases for most inputs, Quicksort is generally considered the “fastest” sorting algorithm.

Which is better selection or bubble sort?

Selection sort performs a smaller number of swaps compared to bubble sort; therefore, even though both sorting methods are of O(N2), selection sort performs faster and more efficiently!

Which is the slowest sorting algorithm?

The correct option is b Bubble sort.

Which of the following sorting algorithm uses divide and conquer?

Quick sort follows Divide-and-Conquer strategy. Explanation: In quick sort, the array is divided into sub-arrays and then it is sorted (divide-and-conquer strategy).

Is selection sort stable or unstable?

Selection sort works by finding the minimum element and then inserting it in its correct position by swapping with the element which is in the position of this minimum element. This is what makes it unstable.

What does a stable sort mean?

A stable sort is one which preserves the original order of the input set, where the [unstable] algorithm does not distinguish between two or more items.

Is selection sort stable or unstable algorithm?

Selection sort is NOT a stable sorting algorithm.

Elements which are equal might be re-arranged in the final sort order relative to one another.