Insertion Sort exhibits _______ complexity when the input array is already sorted.

  • Constant
  • Linear
  • Logarithmic
  • Quadratic
Insertion Sort exhibits constant complexity (O(1)) when the input array is already sorted. In such cases, there is no need for many comparisons or swaps as elements are already in their correct positions.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *