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?
[ Parent
| on HN ]
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.