Template Function ADS::maxSumSegmentLength

Function Documentation

template<class T>
Segment<T> ADS::maxSumSegmentLength(const std::vector<T> &D, std::size_t L, std::size_t U)

a segment of largest sum among those of length in [ L , U ], O( n )

Pre:

1 <= L <= U and L <= the size of D