Is there are effect of insertion sort for repeated numbers?
Answers
Answered by
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
Physics,
7 months ago
Social Sciences,
7 months ago
History,
1 year ago
Physics,
1 year ago
Social Sciences,
1 year ago