ISRO | ISRO CS 2013 | Question 12
Which of the following sorting algorithms has the minimum running time complexity in the best and average case?
(A) Insertion sort, Quick sort
(B) Quick sort, Quick sort
(C) Quick sort, Insertion sort
(D) Insertion sort, Insertion sort
Answer: (A)
Explanation: Insertion sort has a best case complexity of O(n), if the array is already sorted while it has an average case complexity of O(n2)
Quick sort has a best case complexity of O(n log n), while it has an average case complexity of O(n log n) also.
So, option (A) is correct.
Quiz of this Question



