import java.util.Random; /** * We have broken up the computation of the average into computation * of chunks of the intial sum. Here, they happen one at a time, * but in the final version they will happen in parallel. */ public class ArrayAverageChunk { /** * Chunked unit of work for computing the sum. */ private static double sum(int start, int end, Double arr[]) { double tmp = 0; for (int i = start; i