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

1 Answer

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

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.