761 views

2 Answers

Best answer
6 votes
6 votes
an inverstion is i<j and a[i]>a[j] then (a[i],a[j]) is called an inverstion
take the list 4,3,2,1
inverstions:
(4,1)(3,1)(2,1)
(4,2)(3,2)
(4,3)
= 3+2+1= 6
its nothing but sigma(4-1)
if there is a list of 11 elements in decreasing  order, then total inverstions = sigma(11-1) = 10*11/2 = 55
selected by
2 votes
2 votes
Assuming distinct elements, total no of inversions based on given condition = $\frac{10*11}{2} = 55$

Related questions

0 votes
0 votes
0 answers
1
ankitgupta.1729 asked Nov 9, 2017
579 views
How to get number of Inversion count using merge sort?
0 votes
0 votes
1 answer
2
Himanshu1 asked Dec 16, 2015
698 views
A) 192 B) 120 c) 188 D) 176
0 votes
0 votes
0 answers
3
Na462 asked Apr 26, 2018
853 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...
0 votes
0 votes
2 answers
4
sripo asked Dec 25, 2018
4,681 views
In a 3-array tree if internal nodes have exactly 3 children,the number of leaf nodes will be __ ?Does it vary for binary tree?What do you mean by internal nodes? Non roo...