Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread Rahul Singal
Ashim can you please explain the code . thanx in advance -- 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...@go

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread AKASH MANKAR
Ashim, looks good :) nice work On Mon, Sep 6, 2010 at 4:44 PM, Ashim Kapoor wrote: > int a[]={11,9,8,2,10,7,3,4,5} > max_length = 1 ; > current_length = 1; > first_position=0 ; > last_position = 0 ; > first_position_max=0; > // Sweep one to find the length of the longest subsequence. > > for (

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread vignesh radhakrishnan
http://en.wikipedia.org/wiki/Longest_increasing_subsequence On 6 September 2010 14:01, bittu wrote: > u are given an array and u have to print the longest increasing > scattered subsequence...eg..{11,9,8,2,10,7,3,4,5}. > > > Solve it O(n); > > > -- > You received this message because you are sub

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread Ashim Kapoor
int a[]={11,9,8,2,10,7,3,4,5} max_length = 1 ; current_length = 1; first_position=0 ; last_position = 0 ; first_position_max=0; // Sweep one to find the length of the longest subsequence. for ( i = 1 ; i < n ; i++ ) { if ( a[i] > a[i-1] ) { last_position=i-1

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread Vivek Sundararajan
what do you mean by "scattered" subsequence? can you give the expected output for your example case? On 6 September 2010 14:01, bittu wrote: > u are given an array and u have to print the longest increasing > scattered subsequence...eg..{11,9,8,2,10,7,3,4,5}. > > > Solve it O(n); > > > -- > You

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread Sathaiah Dontula
what do you mean by scattered ?, can you please provide an example ? Is it not LIS DP problem which application of LCS ? Thanks, Sathaiah On Mon, Sep 6, 2010 at 2:01 PM, bittu wrote: > u are given an array and u have to print the longest increasing > scattered subsequence...eg..{11,9,8,2,10,7,

[algogeeks] DeShaw Question....tough One

2010-09-06 Thread bittu
u are given an array and u have to print the longest increasing scattered subsequence...eg..{11,9,8,2,10,7,3,4,5}. Solve it O(n); -- 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.c