Time complexity of insertion sort when there are O(n) inversions?

What is an inversion? Given an array arr[], a pair arr[i] and arr[j] forms an inversion if arr[i] < arr[j] and i > j. For … Continue reading Time complexity of insertion sort when there are O(n) inversions?