Sorting · Class 12 · CBSE · Science Computer Science

Which combination correctly describes the standard in-place selection sort for a list of n elements?

Practice question from Sorting (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.

hard · MCQ · Q-188242

Which combination correctly describes the standard in-place selection sort for a list of n elements?

  1. A.It performs Θ(n) comparisons and uses Θ(n) extra space.
  2. B.It performs Θ(n²) comparisons and uses O(1) auxiliary space.Correct answer
  3. C.It performs Θ(n log n) comparisons and uses O(log n) auxiliary space.
  4. D.It performs Θ(n²) comparisons and uses Θ(n) auxiliary space.

Solution

Selection sort scans the remaining unsorted portion during each pass, making a total of Θ(n²) comparisons. Since it sorts by swapping elements within the original list, its auxiliary space requirement is O(1).

More from Sorting

All of Sorting

Practise more Computer Science

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed