An inversion is an array of numbers is any pair (i,j) such
that i<j and A[i]>A[j]. What is the average number of
inversions in an array of n ?
distinct numbers?
Answer Posted / narina thakur
The average number of inversions in an array of N distinct
elements is N(N-1)/4
Proof:
Total number of inversions in a list L and its reverse Lr
is N(N-1)/2. Average list has half this amount, N(N-1)/4.
| Is This Answer Correct ? | 15 Yes | 6 No |
Post New Answer View All Answers
plz send me interview questions & answers of Data Structure
Just a one miniute topics in English?
I have cleared SBT clerk exam and having interview on 29.I have completed my B.tech in IT.I would like to know the types of questions asked in the interview.
I have file with input as below : Name Value Rohan 12,13,14 Rohit 1,2,3 Output should be : Rohan 12 Rohan 13 Rohan 14 Here how will the normalize component work? Thanks
what is the difference between oracle 8i vs 9i
What is the difference between a gun and a rifle and what advantage does a spinning bullet have?
Hello friend I am Manish from delhi I clear the written exam of NIC(national insurance company),If any one have any idea about inerview plz send me details my no:-9999026117,Email id:-bittu523@yahoo.com
is java supprot the complier time pollymorphism or run time pollymorphism ... why
how to prepare for an written exam for any type of company?
which is the better form java or .net?exactly when we have to choose particcular 1 among them?
can any one please tell me what is mean by back papers,back log,historical standing ????????? this mean history of arrears is it correct or not.........
what is buffer solution?
what we have to say about hobbies,strong points,weak points
what is dns?
different types of protocols.......?