+1 vote
in Data Structures & Algorithms II by (110k points)
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

1 Answer

+1 vote
by (614k points)
selected by
Best 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.