[algogeeks] Re: How to find, efficiently, the maximum sum of atleast L consecutive integers from a sequence of N integers.

2006-03-21 Thread aj
geek4u, I agree with you that the original problem description is not very clear, but I guess by "sequence of consecutive integers" he means a substring of the sequence (not just a sequence). If the problem is to find a subsequence (without any restriction on the length of the subsequ

[algogeeks] Re: How to find, efficiently, the maximum sum of atleast L consecutive integers from a sequence of N integers.

2006-03-21 Thread geek4u
@aj . i understand ur approach , but i gave a suggestion , as it was no whr mentioned clearly( abt the substring) coutesy the original problem defintion.On 3/21/06, aj <[EMAIL PROTECTED]> wrote: --~--~-~--~~~---~--~~ You received this message because you are subsc

[algogeeks] Re: How to find, efficiently, the maximum sum of atleast L consecutive integers from a sequence of N integers.

2006-03-21 Thread aj
hey syed, where are you right now? me at EPFL, switzerland. By the way your solution is same as mine (dynamic programming one). Aj B.Tech (CSE), IIT Kanpur '03 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[algogeeks] Re: How to find, efficiently, the maximum sum of atleast L consecutive integers from a sequence of N integers.

2006-03-21 Thread Atif.Hussain
Sorry. I did not fully understand your suggestion. But one thing for certain - you might have to include negative numbers also in your subsequence as it might be accompanied by huge positive numbers before & after. Solution: 0. given array A[0..n] 1. find cumulative sums in B[0..n] can also be d

[algogeeks] Re: How to find, efficiently, the maximum sum of atleast L consecutive integers from a sequence of N integers.

2006-03-21 Thread aj
Ajay Kr. Mishra, well if you don't want the substring and only interested in subsequence (although I guess the original problem was to find a substring), then it is a trivial problem. take all the positive values from sequence (say there are k such values). If k >= L, t