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

Practice Questions

1 question
Q1
What is the worst-case time complexity of insertion sort?
  1. O(n)
  2. O(n log n)
  3. O(n^2)
  4. O(log n)

Questions & Step-by-step Solutions

1 item
Q
Q: What is the worst-case time complexity of insertion sort?
Solution: The worst-case time complexity of insertion sort occurs when the array is sorted in reverse order, resulting in O(n^2).
Steps: 0

Related Questions

Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely