Question 149

Selection sort performs how many swaps in the worst case for n elements?

  1. AO(n)
  2. BO(1)
  3. CO(n^2)
  4. DO(log n)
Show answerHide answer

Correct answer: (A) O(n)

Explanation

At most one swap per pass (n − 1 swaps).

From DSSSB TGT Computer Science Full Mock Test 5

This is question 149 of DSSSB TGT Computer Science Full Mock Test 5. 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.