Class MergeSort

java.lang.Object
sort.studio.merge.MergeSort

public class MergeSort extends Object
Author:
__STUDENT_NAME__, Aaron Handleman, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
  • Constructor Details

    • MergeSort

      public MergeSort()
  • Method Details

    • sequentialMergeSort

      public static void sequentialMergeSort​(int[] data, Combiner combiner) throws InterruptedException, ExecutionException
      Parameters:
      data - the array to sort
      combiner - used to merge the two sub-problem solutions into one
      Throws:
      InterruptedException - if the computation was cancelled
      ExecutionException - if the computation threw an exception
    • parallelMergeSort

      public static void parallelMergeSort​(int[] data, IntPredicate isParallelPredicate, Combiner combiner) throws InterruptedException, ExecutionException
      Parameters:
      data - the array to sort
      isParallelPredicate - Predicate whose test method will return whether or not the current range length is large enough to justify running in parallel.
      combiner - used to merge the two sub-problem solutions into one
      Throws:
      InterruptedException - if the computation was cancelled
      ExecutionException - if the computation threw an exception