You can use either Merge sort or BIT(refer TopCoder tutorial).

-- 
Prakhar Jain
IIIT Allahabad
B.Tech IT 3rd Year
Mob no: +91 9454992196
E-mail: [email protected]
          [email protected]



On Sun, Jul 8, 2012 at 11:31 AM, Navin Kumar <[email protected]>wrote:

> Let A[n] be an array of n distinct number. If i<j and A[i] > A[j] then the
> pair (i , j) is called inversion of A.
>
> Give an algorithm that determines the total number of inversions in
> O(nlogn) time.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/o7L4RLyUMuQJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to