@bhupendra: I think you are talking about longest increasing subword. But, i think the question is longest increasing subsequence! definitions: subword: a contiguous sequence of characters. eg: 'abb' is a subword of 'cabber' subsequence: a sequence of characters of the original string, with order preserved. eg: 'abr' is a subsequence of 'cabber'
But these two terms are used differently at different places! @Anand: Can you clarify what you meant(although i assume it's subsequence)! On Dec 31, 9:07 am, bhupendra dubey <bhupendra....@gmail.com> wrote: > It can be done in O(n) time. > > int start_index=0, longest_sequence=0 > > traverse the sequence and increment 't' for every a[i+1]>a[i] > starting with zero till this holds true. > > assign 't' to longest_sequence > > assuming condition evaluates to false for a[k]; > repeat the above step but assign 't' to longest_sequence only when > t>longest_sequence > also change start_index to 'k' > > do this for the whole array. > > > > On Fri, Dec 31, 2010 at 8:20 AM, Prabakaran N <prabaf...@gmail.com> wrote: > > You can use binary search > > > On 12/31/10, Anand <anandut2...@gmail.com> wrote: > > > Anyone know how to find longest increasing subsequence in O(nlogn) > > > complexity? > > > > -- > > > 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. > > > -- > > 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. > > -- > bhupendra dubey -- 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.