Esempio n. 1
0
 @Override
 protected Integer compute() {
   final int length = end - start;
   if (length < SEQUENTIAL_THRESHOLD) {
     return computeDirectly();
   }
   final int split = length / 2;
   final MaximumFinder left = new MaximumFinder(data, start, start + split);
   left.fork();
   final MaximumFinder right = new MaximumFinder(data, start + split, end);
   return Math.max(right.compute(), left.join());
 }