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?
- A.It performs Θ(n) comparisons and uses Θ(n) extra space.
- B.It performs Θ(n²) comparisons and uses O(1) auxiliary space.Correct answer
- C.It performs Θ(n log n) comparisons and uses O(log n) auxiliary space.
- 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
- Which statement correctly describes the difference between list.sort() and sorted() in Python?
- A single left-to-right pass of bubble sort is performed in ascending order on the list [7, 2, 5, 3, 1]. What will the list be after this pa…
- For an already sorted list of n elements, explain why insertion sort can be more efficient than selection sort, and state the best-case tim…
- In an ascending selection sort, what will the list [64, 25, 12, 22, 11] become after the first pass?
Practise more Computer Science
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed