Which sorting algorithm performs the worst when the input array is nearly sorted?
Show answerHide answer
Correct answer: (B) Insertion Sort
Explanation
Note: the answer key gives (B), but insertion sort is actually the best choice for a nearly sorted array: each element moves only a few places, so it runs in close to O(n) time. The question seems to have intended "best" rather than "worst".