← 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?
- A.It cannot sort numbers larger than 100,000
- B.It needs 100,000 extra arrays
- C.In the worst case it takes about n² = 10¹⁰ steps
- 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 →