On Saturday, September 18, 2010, jagadish jagadish1...@gmail.com wrote:
Hi Raj,
I think there is an nlogn solution to this problem which can be done
by modifying merge sort..
the key lies in the merge routine, when the left array elements are
greater than the right array,
the right array
On Saturday, September 18, 2010, jagadish jagadish1...@gmail.com wrote:
Hi Raj,
I think there is an nlogn solution to this problem which can be done
by modifying merge sort..
the key lies in the merge routine, when the left array elements are
greater than the right array,
the right array
Given an array of n integers find all the inversion pairs in O(n)
Inversion pair is one where a[i]a[j], ij
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from
My two cents
If you were asked in O(n log n)
you have to modified the merge sort algorithm for count the number of
inversion!
Wladimir Araujo Tavares
http://www.si.ufc.br/~wladimir http://www.si.ufc.br/%7Ewladimir/
Fiz uma faculdade! Só não fiz a segunda porque acabaram os tijolos.
On