Computer Science, asked by Shahed5753, 1 year ago

Explain insertion sort best case and worst case time complexity

Answers

Answered by pdpriyabratadap7byj9
1

Answer:

Explanation:

When analyzing algorithms, the average case often has the same complexity as the worst case. So insertion sort, on average, takes O(n2) time. Insertion sort has a fast best-case running time and is a good sorting algorithm to use if the input list is already mostly sorted.

Answered by zakiabasheer2016
0

Insertion sort has a fast best-case running time and is a good sorting algorithm to use if the input list is already mostly sorted. For larger or more unordered lists, an algorithm with a faster worst and average-case running time, such as mergesort, would be a better choice.

Similar questions