Class Slices


public class Slices
extends java.lang.Object
__STUDENT_NAME__, Finn Voichick, Dennis Cosgrove (
  • Constructor Details

  • Method Details

    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(int minInclusive, int maxExclusive, int numSlices)
      Should create a list of IndexedRange objects of length numSlices. Each slice in the returned result should be allocated a balanced amount of the range. Any remaining data should be distributed one each to the front slices.
      minInclusive - minimum (inclusive) of the range to slice
      maxExclusive - maximum (exclusive) of the range to slice
      numSlices - the number of slices to divide [minInclusive, maxExclusive) into
      the created list of slices
    • createNSlices

      public static <C> java.util.List<IndexedRange> createNSlices​(C[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(byte[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(char[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(short[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(int[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(long[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(float[] data, int numSlices)
    • createNSlices

      public static java.util.List<IndexedRange> createNSlices​(double[] data, int numSlices)