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 Mon, Sep 13, 2010 at 1:05 PM, sharad kumar <[email protected]>wrote: > linear decreasing sub sequence problem > > > > On Mon, Sep 13, 2010 at 9:10 PM, Raj N <[email protected]> wrote: > >> Given an array of n integers find all the inversion pairs in O(n) >> Inversion pair is one where a[i]>a[j], i<j >> >> -- >> 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]<algogeeks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > yezhu malai vaasa venkataramana Govinda Govinda > > -- > 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]<algogeeks%[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.
