Question discussion

Which sorting algorithm performs the worst when the input array is nearly sorted?

358864Medium DSSSB TGT Computer Science 0 replies 0 views
0
Which sorting algorithm performs the worst when the input array is nearly sorted?
  • ABubble Sort
  • BInsertion Sort
  • CHybrid Sort
  • DMax Sort
Correct answer: B

Explanation

As per the official answer key, the answer is Insertion Sort. (Note: in theory insertion sort is fast on nearly sorted input, so this key is debatable.)

Discussion 0

Nobody has replied yet. Start the discussion!