1.

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

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.



Discussion

No Comment Found

Related InterviewSolutions