/* A Java class that implements this interface is capable of solving ** the maximum segment sum problem on arrays of integer values. ** ** Author: R. McCloskey ** Date: January 2020 */ public interface MaxSegSum { /* Returns the largest sum among all segments of the given array. */ int maxSegSum(int[] a); /* Returns the largest sum among all subsegments of the given ** array segment (i.e., a[low..high)). ** pre: 0 <= low <= high <= a.length */ int maxSegSum(int[] a, int low, int high); /* Returns the value returned by the most recent call to either version ** of the the maxSegSum() method. */ int maxSegSumVal(); /* Returns a measure of how much work/computation took place in ** carrying out calls to either version of the maxSegSum() method, ** since the last time the reset() method was called (or since this ** object was created, if reset() has never been called). */ long measureOfWork(); /* post: measureOfWork() == 0 */ void reset(); }