Open In App

GATE | Quiz for Sudo GATE 2021 | Question 12

Like Article
Like
Save
Share
Report

Which of the following option is correct considering normal implementations of sorting algorithms?

Note – This question is multiple select questions (MSQ).
(A) Merge Sort, Insertion Sort, and Bubble sort are type of stable sorting algorithms.
(B) Quick Sort, Heap Sort, Selection sort are type of non-stable sorting algorithms.
(C) When the array is sorted, insertion and bubble sort gives complexity of n but quick sort gives complexity of n^2.
(D) When order of input is not known, merge sort is preferred as it has worst case time complexity of nlogn and it is NOT stable as well.


Answer: (A) (B) (C)

Explanation: Merge Sort, Insertion Sort, and Bubble Sort are type of stable sorting algorithms.

Quick Sort, Heap Sort, Selection Sort are type of non-stable sorting algorithms.

When order of input is not known, merge sort is preferred as it has worst case time complexity of nlogn and it is stable as well.

Only option (D) is false.

Refer – Analysis of different sorting techniques

Quiz of this Question


Last Updated : 15 Dec, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads