Tag Archives: smaller count on right

Count Inversions – Count Smaller on Right

Given an integer array, count the number of inversions. Inversion count is the distance of order of elements in an array from the the sorted order i.e. it indicates how far (or close) the array is from being sorted. If array is already sorted then inversion count is 0. If array is sorted in reverse […]