1.

What is the auxiliary space complexity of standard merge sort?(a) O(1)(b) O(log n)(c) O(n)(d) O(n log n)The question was posed to me during an online exam.Enquiry is from Sorting topic in section Sorting of Data Structures & Algorithms II

Answer»

Right option is (C) O(n)

Easiest explanation - The merging of two sorted arrays requires an additional SPACE of n due to which the auxiliary space REQUIREMENT of merge SORT is O(n). Thus merge sort is not an in PLACE sorting algorithm.



Discussion

No Comment Found

Related InterviewSolutions