Name that algorithm (a small puzzle)
Charles Fineman
cef at h.gp.cs.cmu.edu
Fri Jan 6 03:25:36 AEST 1989
A friend showed me a interestng problem the other day. In light of
the interest in the 2^n celing problem a couple of months ago, I
thought y'all might be interested...
Let a sequence of integers be given. Define a "maximal"
sub-string to be a sub-string whose sum is the greatest
of all sub-strings (there could be more than one).
Find the cheapest (time-wise) algorithm that will find a
"maximal" subsequence and return its range and sum.
I will post my solution in a few days if there is sufficient interest.
Charlie Fineman
--
More information about the Comp.lang.c
mailing list