1.

What is the auxiliary space complexity of bottom up merge sort?(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)The question was posed to me during an interview.The above asked question is from Sorting in section Sorting of Data Structures & Algorithms II

Answer»

Right answer is (b) O(n)

The best EXPLANATION: The auxiliary space complexity of bottom up merge sort is same as standard merge sort as both USES the same algorithm for merging the sorted arrays which takes o(n) space. But bottom up merge sort does not NEED to maintain a CALL stack.



Discussion

No Comment Found

Related InterviewSolutions