Re: [algogeeks] Max Arithmetic Subsequence

2011-07-14 Thread Navneet Gupta
It worked fine on sorted input. On Wed, Jul 13, 2011 at 5:46 AM, Navneet Gupta wrote: > OOPS..Bad miss :( > > On Tue, Jul 12, 2011 at 11:53 PM, sunny agrawal > wrote: >> Algorithm in the paper says works only on sorted arrays >> it is mentioned in the paper itself >> >> On Tue, Jul 12, 2011

Re: [algogeeks] Max Arithmetic Subsequence

2011-07-12 Thread sunny agrawal
Algorithm in the paper says works only on sorted arrays it is mentioned in the paper itself On Tue, Jul 12, 2011 at 11:21 PM, Navneet Gupta wrote: > I wrote the code as someone gave the reference of the paper where algo > to get max arithmetic subsequence was given. > > For an input of {2,9,4,1,6

[algogeeks] Max Arithmetic Subsequence

2011-07-12 Thread Navneet Gupta
I wrote the code as someone gave the reference of the paper where algo to get max arithmetic subsequence was given. For an input of {2,9,4,1,6,7,8,3,10}, i am getting an output of 3, while it should be 5 for {2,4,6,8,10} Below is the implementation, can someone help me understand where am i going