1.

What is the average case time complexity of standard merge sort?(a) O(n log n)(b) O(n^2)(c) O(n^2 log n)(d) O(n log n^2)The question was asked in an online quiz.This intriguing question originated from Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

Right CHOICE is (a) O(n LOG n)

The best EXPLANATION: The recurrence relation for merge sort is given by T(n) = 2T(n/2) + n. This can be solved using master’s theorem and is found EQUAL to O(n log n).



Discussion

No Comment Found

Related InterviewSolutions