java.lang.Object
provided.listFW.visitors.SumRevAlgo
- All Implemented Interfaces:
IListAlgo
Returns the sum of a list of integers using reverse accumulation.
The input parameter is not used ("nu").
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SumRevAlgo
public SumRevAlgo()
-
-
Method Details
-
emptyCase
Returns zero always. -
nonEmptyCase
Returns first plus the sum of the rest of the list.- Specified by:
nonEmptyCase
in interfaceIListAlgo
- Parameters:
host
- theNEList
that is executing this algorithmnu
- a variable number of input parameters that can be used for any purpose.- Returns:
- result from calling this method. The type of the result is problem-specific and may be null.
-