1.

Which of the following sorting algorithm is NOT stable?(a) Selection sort(b) Brick sort(c) Bubble sort(d) Merge sortThis question was posed to me during an interview.This key question is from Recursion topic in division Recursion of Data Structures & Algorithms II

Answer»

The correct answer is (a) Selection sort

Easiest explanation - Out of the GIVEN options selection sort is the only algorithm which is not stable. It is because the ORDER of identical elements in sorted output may be DIFFERENT from INPUT array.



Discussion

No Comment Found

Related InterviewSolutions