Package sort.challenge.quick
Class ParallelPartitioner
java.lang.Object
sort.challenge.quick.ParallelPartitioner
- All Implemented Interfaces:
Partitioner
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
ConstructorsConstructorDescriptionParallelPartitioner(ExecutorService executor, int threshold)ParallelPartitioner(ExecutorService executor, int threshold, PivotInitialIndexSelector pivotValueSelector) -
Method Summary
Modifier and TypeMethodDescriptionpartitionRange(int[] data, int min, int maxExclusive)Partitions the data in range between min (inclusive) and maxExclusive in place such that all values at indices lower than the pivot index are lower than all of the values at indices higher than the pivot index.
-
Constructor Details
-
ParallelPartitioner
public ParallelPartitioner(ExecutorService executor, int threshold, PivotInitialIndexSelector pivotValueSelector) -
ParallelPartitioner
-
-
Method Details
-
partitionRange
public PivotLocation partitionRange(int[] data, int min, int maxExclusive) throws InterruptedException, ExecutionExceptionDescription copied from interface:PartitionerPartitions the data in range between min (inclusive) and maxExclusive in place such that all values at indices lower than the pivot index are lower than all of the values at indices higher than the pivot index.- Specified by:
partitionRangein interfacePartitioner- Parameters:
data- the array to partitionmin- the minimum value (inclusive) of the range to partitionmaxExclusive- the maximum value (exclusive) of the range to partition- Returns:
- the location of the pivot
- Throws:
InterruptedException- if the computation was cancelledExecutionException- if the computation threw an exception
-