Question discussion

What is the maximum number of swaps that can be performed in the Selection Sort algorithm?

359454Medium DSSSB TGT Computer Science 0 replies 0 views
0
What is the maximum number of swaps that can be performed in the Selection Sort algorithm?
  • A1
  • Bn - 1
  • Cn - 2
  • Dn
Correct answer: B

Explanation

Selection sort makes at most one swap per pass over n − 1 passes, so the maximum is n − 1 swaps.

Discussion 0

Nobody has replied yet. Start the discussion!