Class ParallelPartitioner

java.lang.Object
sort.challenge.quick.ParallelPartitioner
All Implemented Interfaces:
Partitioner

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

  • Method Details

    • partitionRange

      public PivotLocation partitionRange​(int[] data, int min, int maxExclusive) throws InterruptedException, ExecutionException
      Description copied from interface: Partitioner
      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.
      Specified by:
      partitionRange in interface Partitioner
      Parameters:
      data - the array to partition
      min - the minimum value (inclusive) of the range to partition
      maxExclusive - the maximum value (exclusive) of the range to partition
      Returns:
      the location of the pivot
      Throws:
      InterruptedException - if the computation was cancelled
      ExecutionException - if the computation threw an exception