Template Function ADS::maxSubarraySum

Function Documentation

template<class T>
T ADS::maxSubarraySum(const std::vector<T> &A)

the largest sum of a subvector, the empty one included, O( n )

Post:

the result is not negative