yes, but in O(n)? How? in O(n^2) its easy. For every int, if successive ints are lesser, you've found a pair.
How can you find all pairs in o(n) time? On Sep 13, 9:05 am, 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%2bunsubscr...@googlegroups > > .com> > > . > > 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]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
