Check out maximum contiguous subsequence problem. It is a very common dynamic programming problem and it uses O(1) space.
On Wed, Jun 30, 2010 at 19:00, jalaj jaiswal <[email protected]>wrote: > You have an array of n nonzero numbers. The array is randomly filled with > positive and negative numbers. > > Write an algorithm/program to find 2 such indexes in the array, so as the > sum of the numbers between these indexes is the maximum. O(n). > > please explain the logic > > -- > With Regards, > Jalaj Jaiswal > +919026283397 > B.TECH IT > IIIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
