Computer Science, asked by rykv4816, 1 year ago

Is there are effect of insertion sort for repeated numbers?

Answers

Answered by Akhilrajput1
0
Therefore total number of while loop iterations (For all values of i) is same as number of inversions. ... If the inversion count is O(n), then the time complexity of insertion sort is O(n). In worst case, therecan be n*(n-1)/2 inversions. The worst case occurs when the array is sorted in reverse order.
Similar questions