1.

Which of the following sorting algorithm is stable?(a) Heap sort(b) Selection sort(c) In-place MSD radix sort(d) LSD radix sortThe question was posed to me in an online interview.My question is taken from Sorting topic in division Sorting of Data Structures & Algorithms II

Answer»

Right answer is (d) LSD radix sort

Easiest explanation - In LSD radix sort after sorting the MULTIPLE ELEMENTS with the same key will be in the same ORDER as they were in the INPUT array. So LSD radix sort is stable sort.



Discussion

No Comment Found

Related InterviewSolutions