🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Bubble sort
  2. B.Insertion sort
  3. C.Selection sort
  4. 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 →