🎙 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 8 of 13

An array has 100,000 items. Why is insertion sort a poor choice here?

An array has 100,000 items. Why is insertion sort a poor choice here?

  1. A.It cannot sort numbers larger than 100,000
  2. B.It needs 100,000 extra arrays
  3. C.In the worst case it takes about n² = 10¹⁰ steps
  4. D.It only works on strings
Answer & explanation

Correct answer: In the worst case it takes about n² = 10¹⁰ steps

O(n²) on 10⁵ items is around ten billion steps; use an O(n log n) sort instead.

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 →