1.

Cocktail sort is a variation of _____________(a) Bubble sort(b) Selection sort(c) Insertion sort(d) Gnome sortI got this question in my homework.Asked question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer»

Right ANSWER is (a) Bubble sort

To EXPLAIN: Cocktail sort is very similar to bubble sort. It WORKS by traversing an array in both directions alternatively. It compares the adjacent ELEMENTS in each iteration and SWAPS the ones which are out of order.



Discussion

No Comment Found

Related InterviewSolutions