1.

What is the auxiliary space complexity of randomized quick sort?(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)The question was posed to me in my homework.My question is based upon Sorting topic in section Sorting of Data Structures & Algorithms II

Answer»

Right choice is (C) O(LOG n)

Best explanation: Auxiliary space complexity of randomized 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