← Quiz: Sorting Basics: all 13 questions
Quiz: Sorting Basics · Question 5 of 13
You must sort an array where every write to memory is very costly. Which simple sort writes the least?
You must sort an array where every write to memory is very costly. Which simple sort writes the least?
- A.Bubble sort
- B.Insertion sort
- C.Selection sort
- D.They all make the same number of writes
Answer & explanation
Correct answer: Selection sort
Selection sort makes at most n − 1 swaps, while bubble and insertion can move items O(n²) times.
Can you get the rest right without peeking?
Take the timed Quiz: Sorting Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →