Question 60Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

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

  1. ABubble Sort
  2. BInsertion Sort
  3. CHybrid Sort
  4. DMax Sort
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".

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

This is question 60 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.