1.

Which of the following pair of sorting algorithms are stable?(a) gnome sort and quick sort(b) merge sort and selection sort(c) gnome sort and merge sort(d) heap sort and merge sortI got this question by my college director while I was bunking the class.I'd like to ask this question from Sorting in division Sorting of Data Structures & Algorithms II

Answer»

Right OPTION is (c) gnome sort and merge sort

The best EXPLANATION: Gnome sort and merge sort are STABLE sorting algorithms as the elements with IDENTICAL values appear in the same order in the output array as they were in the input array when any of these sorting algorithms are implemented.



Discussion

No Comment Found

Related InterviewSolutions