+1 vote
in Data Structures & Algorithms II by (110k points)
What is the auxiliary space complexity of merge sort?

(a) O(1)

(b) O(log n)

(c) O(n)

(d) O(n log n)

The question was asked in final exam.

The origin of the question is Sorting in division Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
The correct answer is (c) O(n)

The best I can explain: An additional space of O(n) is required in order to merge two sorted arrays. Thus merge sort is not an in place sorting algorithm.

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.