1.

Odd-even sort is a variation of ___________(a) Bubble sort(b) Selection sort(c) Insertion sort(d) Gnome sortI got this question in an internship interview.The above asked question is from Sorting topic in portion Sorting of Data Structures & Algorithms II

Answer»

The CORRECT choice is (a) Bubble sort

Easy explanation - Odd-EVEN sort is very similar to bubble sort. It works by applying bubble sort in two phases I.e odd PHASE and even phase. In odd phase bubble sort is applied on odd indexed ELEMENTS and in even phase bubble sort is applied on even indexed elements.



Discussion

No Comment Found

Related InterviewSolutions