Question discussion

The best-case time complexity of insertion sort is

1567Medium DSSSB TGT Computer Science 0 replies 1 views
0

The best-case time complexity of insertion sort is

  • AO(1)
  • BO(log n)
  • CO(n)
  • DO(n²)
Correct answer: C

Explanation

If the array is already sorted, each element is compared once with its predecessor and no shifting is needed, so the best case is O(n).

Discussion 0

Nobody has replied yet. Start the discussion!