Using Recursion Find Largest Element Array Skeleton Code Provided Please Change Datasetdem Q37076704

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.