Abstract:The maximal sum of a sequence A of n real numbers is the greatest sum of all elements of any linearly contiguous and possibly empty subsequence of A. It can be computed in O(n) time by means of Kadane's algorithm. Letting A (x→p) denote the sequence which results from inserting a real number x just after element A[p − 1], we show how the maximal sum of A (x→p) can be computed in O(1) worst-case time for any given x and p, provided that an O(n) time preprocessing step has already been executed on A. In particul… Show more
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.