What is the worst-case time complexity of insertion sort ?

2026

What is the worst-case time complexity of insertion sort ?

  1. A.

    O(n)

  2. B.

    O(n log n)

  3. C.

    O(n^2)

  4. D.

    O(log n)

Attempted by 253 students.

Show answer & explanation

Correct answer: C

The worst-case time complexity of insertion sort is O(n^2). This occurs when the input array is reverse sorted, requiring maximum comparisons and swaps for each element.

Explore the full course: Tpsc Assistant Technical Officer