import java.util.concurrent.*; import java.util.*; /* This class is nearly identical to FindMin, but it extends RecursiveAction instead of RecursiveTask. The only difference there is that compute() returns nothing, so we store the min value in 'result'. */ public class FindMinAlt extends RecursiveAction { 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; int result; public FindMinAlt(int[] a,int l,int h) { array=a; lo=l; hi=h; } public void 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