Question discussion

The number of element comparisons made by selection sort on an array of 8 elements is

2362Medium DSSSB TGT Computer Science 0 replies 1 views
0

The number of element comparisons made by selection sort on an array of 8 elements is

  • A56
  • B28
  • C7
  • D36
Correct answer: B

Explanation

Selection sort always makes (n − 1) + (n − 2) + … + 1 = n(n − 1) / 2 = 28 comparisons, whatever the input order.

Discussion 0

Nobody has replied yet. Start the discussion!