[Solved] What does the number of inversions in an array indicate?

What does the number of inversions in an array indicate?

a) mean value of the elements of the array
b) measure of how close or far the array is from being sorted
c) the distribution of values in the array
d) median value of the elements of array

Answer: b
Explanation: The number of inversions in an array indicates how close or far the array is from being completely sorted. The array is sorted if the number of inversions is 0.

Comments