Package sort.studio.merge
Class MergeSort
java.lang.Object
sort.studio.merge.MergeSort
- Author:
- __STUDENT_NAME__, Aaron Handleman, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidparallelMergeSort(int[] data, IntPredicate isParallelPredicate, Combiner combiner)static voidsequentialMergeSort(int[] data, Combiner combiner)
-
Constructor Details
-
MergeSort
public MergeSort()
-
-
Method Details
-
sequentialMergeSort
public static void sequentialMergeSort(int[] data, Combiner combiner) throws InterruptedException, ExecutionException- Parameters:
data- the array to sortcombiner- used to merge the two sub-problem solutions into one- Throws:
InterruptedException- if the computation was cancelledExecutionException- 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 sortisParallelPredicate- 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 cancelledExecutionException- if the computation threw an exception
-