ISRO 2008 · Selection Sort

MCQ · 1 mark · Problem PROG-SORT-0046

How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order?
  1. A
    1
  2. B
    10
  3. C
    15
  4. D
    20

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/17268/isro2008-77

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com