Which of the following algorithm is best suited for the case where swap operation is expensive?

Daniel William

New member
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 sort
 
Answer: b
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.
 

Tìm kiếm

Back
Top