Questions: Selection Sort Algorithm

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

An array of 1,000 elements is already perfectly sorted. How many comparisons does selection sort make?

AZero — it detects the sorted order and terminates early
BAbout 1,000 — one per element to verify it is in place
C499,500 — the same n(n−1)/2 it would make on any input
DAbout 500,000, but fewer than for a reversed array
Question 2 Multiple Choice

You are sorting records stored in flash memory, where each write operation physically degrades the storage medium. Which property of selection sort makes it most appropriate for this context?

ASelection sort is O(n log n) in the best case, minimizing total operations
BSelection sort is stable, preserving the original order of equal-key records
CSelection sort makes exactly n−1 swaps, minimizing the number of write operations
DSelection sort runs entirely in-place, requiring no additional flash memory
Question 3 True / False

Selection sort makes exactly n−1 swaps to sort an array of n elements, regardless of the initial ordering.

TTrue
FFalse
Question 4 True / False

Selection sort is generally faster than insertion sort on nearly-sorted input because selection sort makes fewer swaps.

TTrue
FFalse
Question 5 Short Answer

Explain why selection sort's time complexity is O(n²) in the best case, even when the input is already sorted. What algorithmic property causes this?

Think about your answer, then reveal below.