Using recursion, find the largest element in an array. Askeleton code is provided. Please do not change the DataSetDemocode.
Hint: Find the largest element in the subset containing all butthe last element. Then compare that maximum to the value of thelast element.
Skeleton Code:
DATA SET
/**
Computes the maximum of a set of data values.
*/
public class DataSet
{
private int[] values;
private int first;
private int last;
/**
Constructs a DataSet object.
@param values the data values
@param first the first value in the data set
@param last the last value in the data set
*/
public DataSet(int[] values, int first, int last)
{
this.values = values;
this.first = first;
this.last = last;
}
/**
Gets the maximum in the set of
OR
OR