retagged by
795 views
2 votes
2 votes
Assume that A be an array of 16 elements. What is the difference between maximum number of inversion and minimum number of inversion for the array with 16 elements?
retagged by

1 Answer

Best answer
2 votes
2 votes
Array with 16 distinct elements arranged in decreasing order, will have $\binom{16}{2}$ inversions. Array with all elements equal will have 0 inversions. Difference = $\binom{16}{2} = 120$.
selected by
Answer:

Related questions

2 votes
2 votes
1 answer
3
0 votes
0 votes
1 answer
4
Raghav Khajuria asked Oct 13, 2018
322 views
Minimum no of comparisons required to find the minimum and maximum of n distinct elements