Talk:Greatest subsequential sum: Difference between revisions

no edit summary
(About my change to the article)
No edit summary
Line 4:
 
: Ok, I now have changed the text to my interpretation (I've taken the most liberal interpretation, i.e. not fixing at all which subsequence to take in case more than one has the same value; I also allow empty sequences, which have sum 0, because I think that's what the Ruby code does). I've also added a C++ implementation (which I believe behaves exactly like the ruby one, thus I hope that even if my interpretation of the task turns out not to be what was meant, the code should still be correct for the task to be solved).
 
==<i>subarray</i> is a somewhat unclear term==
The task does not specify anything about the presumed topology of the "subarray": In some languages, the "shape" of an array can be a rather fuzzy notion, and even if your language has precise rectangular, evenly-spaced arrays, it is not clear from the spec whether the supposed "subarray" has to have a rectangular shape. For example in 2 dimensions, an array could be a grid and this task might be asking for a L-shaped area in that grid. Or maybe only convex shapes are allowed. Or, indeed, only rectangles. What if an "L" can be turned into a rectangle by adding an element that contains zero? I think there needs a much clearer statement of purpose here somewhere... [[User:Sgeier|Sgeier]] 18:13, 3 August 2007 (EDT)
Anonymous user