How many iterations are required to sort the array arr={2,3,4,5,1} using bubble sort and cocktail sort respectively?
(a) 4,2
(b) 5,3
(c) 5,2
(d) 4,3
The question was posed to me at a job interview.
Asked question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II