[algogeeks] Inversion problem

2012-07-08 Thread Navin Kumar
Let A[n] be an array of n distinct number. If ij 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

Re: [algogeeks] Inversion problem

2012-07-08 Thread Prakhar Jain
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.comwrote: Let A[n] be an

Re: [algogeeks] Inversion problem

2012-07-08 Thread Krishnan
Try like merge sort. http://www.geeksforgeeks.org/archives/3968 -- 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