1.

What is the auxiliary space complexity of a median of three quick sort?(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)I got this question in homework.Question is from Sorting topic in section Sorting of Data Structures & Algorithms II

Answer»

The CORRECT option is (c) O(log n)

The explanation is: Auxiliary space complexity of median of three QUICK sort is O(log n) which is used for STORING call stack formed due to recursion. NOTE that the algorithms with space complexity as O(log n) also qualifies as in place algorithms as the value of log n is CLOSE to 1.



Discussion

No Comment Found

Related InterviewSolutions