News for hackers. Stuff that matters.
Re:A candidate not versed in prog folklore = not suitable fo... by DannoHung on Friday December 03, 2010 @02:48PM (#1967191)
The linear solution looks like it depends on the maximum subsequence being greater than zero. Is there a similar solution that can produce Integer results?
Re:A candidate not versed in prog folklore = not suitable fo... by aidenn0 on Friday December 03, 2010 @02:55PM (#1967225)
Well it's linear time to find the maximum element of a sequence (which is equal to the maximum subsequence when all are non-positive), so you can by definition do both in linear time.
Re:A candidate not versed in prog folklore = not suitable fo... by skew on Friday December 03, 2010 @04:54PM (#1967588)
If the empty subsequence is allowed, it's always possible to get at least zero.
Re:A candidate not versed in prog folklore = not suitable fo... by aidenn0 on Tuesday December 07, 2010 @05:39PM (#1980955)
Eh, one could argue that the sum of the empty subsequence is undefined.
Re:A candidate not versed in prog folklore = not suitable fo... by DannoHung on Friday December 03, 2010 @11:49PM (#1968531)
Good point, I wasn't thinking.