OK then I guess this will do but not sure. 1. Traverse the list from 1st to n-k (if n is the length of the list). only those numbers to the left of this index n-k can be represented as the starting number in sequence. 2. Also mark the indices of increasing number. i.e., for the above list:- list=> 7,8,9,4,10,11 so till 3rd index we should traverse; for each number, 7 8,9,10,11 89,10,11 910,11 410,11 3. Now taking 3 numbers(k=3) at a time and leaving the rest.i.e., 7 8 9, 7 8 10, 7 8 11, 7 9 10, 7 9 11, 7 10 11 8 9 10, 8 9 11, 8 10 11, 9 10 11 4 10 11
On Feb 7, 4:26 pm, atul anand <atul.87fri...@gmail.com> wrote: > @vetri : yes right , include your sequence to my output. > > > > > > > > On Tue, Feb 7, 2012 at 4:07 PM, vetri <natarajananitha...@gmail.com> wrote: > > hi atul, > > will the output also have these sequence or only those you mentioned? > > + 7 8 11 > > + 7 8 10 > > + 7 9 11 > > + 8 9 11 > > + 4 10 11 > > can u explain the question more? > > > On Jan 30, 12:43 pm, Manni mbd <mbd2...@gmail.com> wrote: > > > @Manee: can u explain a bit more !! still unclear > > > > On 1/30/12, Manee <mani.ma...@gmail.com> wrote: > > > > > store all the indices wherever the value decreases. all subsequences > > > > between 0, these indices and the end index n are increasing > > > > subsequences. > > > > > Check which of these are of length K. > > > > > On Jan 26, 11:17 pm, atul anand <atul.87fri...@gmail.com> wrote: > > > >> Hi, > > > > >> suggest an algo which will find all longest increasing sub > > > >> sequence of length K. > > > > >> for eg:- > > > >> input : 7 8 9 4 10 11 > > > >> K=3 > > > > >> output : > > > >> 7 8 9 > > > >> 7 9 10 > > > >> 7 10 11 > > > >> 8 9 10 > > > >> 8 10 11 > > > > >> desired complexity : O(k*n*logn) > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "Algorithm Geeks" group. > > > > To post to this group, send email to algogeeks@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. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to algogeeks@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. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@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.