1.

What is the average time complexity of stooge sort?(a) O(n^2)(b) O(n^3)(c) O(n^2.6)(d) O(n^2.7)The question was posed to me during an internship interview.I'd like to ask this question from Sorting in division Sorting of Data Structures & Algorithms II

Answer»

The CORRECT answer is (d) O(n^2.7)

Easiest explanation - The recurrence relation of stooge sort is given as T(n) = 3T(2/3n) + O(1). It is found to be equal to O(n^2.7) USING the master’s THEOREM.



Discussion

No Comment Found

Related InterviewSolutions