InterviewSolution
Saved Bookmarks
| 1. |
Which of the following algorithm is best suited for the case where swap operation is expensive?(a) bubble sort(b) cycle sort(c) cocktail sort(d) merge sortI got this question during an internship interview.Origin of the question is Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (b) cycle SORT Easy EXPLANATION - Cycle sort is a slow sorting algorithm but it requires a minimum number of write operations in ORDER to sort a given ARRAY. So it is useful when the write/swap operation is expensive. |
|