GATE CS 2009 · Selection Sort

MCQ · 1 mark · Problem PROG-SORT-0045

What is the number of swaps required to sort n elements using selection sort, in the worst case?
  1. A
    \(\theta (n)\)
  2. B
    \(\theta (n logn)\)
  3. C
    \(\theta (n^{2})\)
  4. D
    \(\theta (n^{2} logn)\)

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

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1303/gate2009-11

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