← Quiz: Searching and Sorting in C: all 10 questions
Quiz: Searching and Sorting in C · Question 9 of 10
What is the main advantage of selection sort?
What is the main advantage of selection sort?
- A.It is O(n) on sorted input
- B.It makes at most n − 1 swaps
- C.It is stable
- D.It is O(n log n)
Answer & explanation
Correct answer: It makes at most n − 1 swaps
Fewer swaps help when writing data is costly, but comparisons are always about n²/2.
Can you get the rest right without peeking?
Take the timed Quiz: Searching and Sorting in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →