← Quiz: Sorting Basics: all 13 questions
Quiz: Sorting Basics · Question 13 of 13
For which input does insertion sort do the most work?
For which input does insertion sort do the most work?
- A.An array that is already sorted
- B.An array where all values are equal
- C.An array sorted in reverse order
- D.An array with only two items
Answer & explanation
Correct answer: An array sorted in reverse order
Each new item must be shifted past all the items before it, giving O(n²) shifts.
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 →