1.

Which of the following algorithm is stable?(a) heap sort(b) cube sort(c) quick sort(d) bogosortI have been asked this question during an interview.The query is from Sorting in section Sorting of Data Structures & Algorithms II

Answer»

The CORRECT ANSWER is (d) bogosort

The EXPLANATION is: Out of the GIVEN algorithms only cube sort is stable. This implies that the relative POSITION of equal valued elements in the input and sorted array remains the same.



Discussion

No Comment Found

Related InterviewSolutions