1.

Which of the following sorting algorithm is stable?(a) Selection sort(b) Quick sort(c) Tree sort(d) Heap sortI had been asked this question in semester exam.I'd like to ask this question from Sorting in chapter Sorting of Data Structures & Algorithms II

Answer»

Right answer is (C) Tree sort

For explanation: Out of the given OPTIONS Tree sort is the only algorithm which is STABLE. It is because the elements with identical values appear in the same ORDER in the output ARRAY as they were in the input array.



Discussion

No Comment Found

Related InterviewSolutions