Last Updated : 19 Nov, 2018

Match the List-1: Sorting algorithm to List-II: best time complexity on input N.

List-I List-II
(a) Insertion sort (i) O(N log N)
(b) Quick sort (ii) O(N2)
(c) Heap sort (iii) O(N )
(d) Merge sort (iv) O(log N)

(A) 1
(B) 2
(C) 3
(D) 4


Answer: (C)

Explanation: Insertion sort takes O(n) time in best case.
Quick sort takes O(nlogn) time in best case.
Heap sort takes O(n) time in best case.
Merge sort takes O(nlogn) in best case.
So, option (C) is correct.

Quiz of this Question


Share your thoughts in the comments