1.

Which of the following sorting algorithm is in-place?(a) Merge sort(b) Cycle sort(c) Counting sort(d) Radix sortThis question was addressed to me during a job interview.My question is based upon Sorting in division Sorting of Data Structures & Algorithms II

Answer» RIGHT OPTION is (b) Cycle sort

Best EXPLANATION: Cycle sort has an auxiliary SPACE COMPLEXITY of O(1). So it qualifies to be an in-place sort. All other given options are not in place sorting algorithm.


Discussion

No Comment Found

Related InterviewSolutions