Multiple choice

Insertion sort's worst-case time complexity is

  1. O(n2)

  2. O(nlogn)

  3. O(logn)

  4. O(n)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In the worst case, such as a reverse-sorted array, every element must be compared and shifted across all previously sorted elements, leading to O(n^2).