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 <aryansmit3...@gmail.com> wrote: > linear decreasing sub sequence problem > > On Mon, Sep 13, 2010 at 9:10 PM, Raj N <rajn...@gmail.com> 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 algoge...@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com<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 algoge...@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.