717 views

1 Answer

Best answer
5 votes
5 votes
Maximum inversion occurs when an array is in reverse order.

So,max no of inversion in an array is

(n-1)+(n-2)+.........+1=n*(n-1)/2

Here n=16

So, max no of inversion is 120.

Now minimum no of inversion occurs when array is in sorted

Then minimum no of inversion in array is 0.

The difference is 120
selected by

Related questions

0 votes
0 votes
0 answers
1
ankitgupta.1729 asked Nov 9, 2017
605 views
How to get number of Inversion count using merge sort?
0 votes
0 votes
0 answers
2
Na462 asked Apr 26, 2018
901 views
Is it always the case that in an unsorted array using comparison based sorting algorithm the minimum number of comparison required to convert it into sorted array is Equa...