Talk:Greatest subsequential sum: Difference between revisions

No edit summary
Line 7:
==<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)
 
: From the original Ruby example code, I'd expect it to be restricted to one-dimensional arrays. That's also what I implemented in C++ (actually, my function works not only on arrays, but on any sequence accessible through forward iterators, but sequences are one-dimensional by definition, too). An obvious restriction is, of course, that the array has a finite number of elements (some languages may be able to describe infinite arrays).
: Possibly renaming the article from "Maximum subarray" to "Maximum subsequence" would be a good idea (after all, the interesting part here is the algorithm, not the actual data structure used to store it; e.g. in Lisp, one might prefer to use lists rather than arrays). Or even better, rename it to something like "Subsequence with maximal element sum" (surely a better new title can be found along this line). --[[User:Ce|Ce]] 20:45, 4 August 2007 (EDT)
973

edits