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: rit2009...@iiita.ac.in jprakha...@gmail.com
On Sun, Jul 8, 2012 at 11:31 AM, Navin Kumar <algorithm.i...@gmail.com>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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.