import java.util.concurrent.*; //you'll need to import this to use the ForkJoin stuf import java.util.*; /* This class shows how to find the minimum element in an array of integers, using the forkjoin framework. It contains a main method for testing it out as well. */ //Your ForkJoin program will either need to extend RecursiveTask or RecursiveAction (see FindMinAlt for an example using RecursiveAction) public class FindMin extends RecursiveTask { //The ForkJoinPool is needed to start the entire process //We'll only need 1 for the entire project, hence the 'static' static final ForkJoinPool fjPool=new ForkJoinPool(); int[] array; int lo,hi; //this represents the range considered by this instance. Remember that we start at 'lo', and go to 'hi-1' static final int SEQUENTIAL_CUTOFF=1000; public FindMin(int[] a,int l,int h) { array=a; lo=l; hi=h; } public Integer compute() { //first we check if it's at or below the sequential cutoff; if so, do it the easy way if(hi-lo<=SEQUENTIAL_CUTOFF) { int min=Integer.MAX_VALUE; for(int i=lo;i