java.lang.Object
speiger.src.collections.shorts.utils.ShortArrays

public class ShortArrays extends Object
A Helper class for Arrays
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final int
    Default Limit for Insertion/Selection Sort
    static final short[]
    Empty Array Reference used for Uninitialized Collections
    static final int
    Default Threshold for Multithreaded Sorting Algorythm options
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static short[]
    heapify(short[] data, int size, ShortComparator comp)
    Helper function to create a Heap out of an array.
    static short[]
    insertionSort(short[] array)
    Sorts an array according to the natural ascending order using InsertionSort,
    static void
    insertionSort(short[] array, int length)
    Sorts an array according to the natural ascending order using InsertionSort,
    static void
    insertionSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using InsertionSort,
    static void
    insertionSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
    static void
    insertionSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
    static short[]
    insertionSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
    static short[]
    memFreeMergeSort(short[] array)
    Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    memFreeMergeSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    memFreeMergeSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    memFreeMergeSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    memFreeMergeSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    memFreeMergeSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static short[]
    mergeSort(short[] array)
    Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    mergeSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    mergeSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    mergeSort(short[] array, short[] supp, int from, int to)
    Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    mergeSort(short[] array, short[] supp, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static short[]
    mergeSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMemFreeMergeSort(short[] array)
    Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    parallelMemFreeMergeSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    parallelMemFreeMergeSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    parallelMemFreeMergeSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    parallelMemFreeMergeSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array.
    static void
    parallelMergeSort(short[] array)
    Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMergeSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMergeSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMergeSort(short[] array, short[] supp, int from, int to)
    Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMergeSort(short[] array, short[] supp, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelMergeSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using a Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
    static void
    parallelQuickSort(short[] array)
    Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    parallelQuickSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    parallelQuickSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    parallelQuickSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    parallelQuickSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    parallelQuickSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static short[]
    A Helper function that pours all elements of a iterator into a Array
    static short[]
    pour(ShortIterator iter, int max)
    A Helper function that pours all elements of a iterator into a Array
    static short[]
    quickSort(short[] array)
    Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    quickSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    quickSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    quickSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static void
    quickSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static short[]
    quickSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L.
    static short[]
    reverse(short[] array)
    Simple Array Reversal method
    static short[]
    reverse(short[] array, int length)
    Simple Array Reversal method
    static short[]
    reverse(short[] array, int offset, int length)
    Simple Array Reversal method
    static short[]
    selectionSort(short[] array)
    Sorts an array according to the natural ascending order using Selection Sort,
    static void
    selectionSort(short[] array, int length)
    Sorts an array according to the natural ascending order using Selection Sort,
    static void
    selectionSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order using Selection Sort,
    static void
    selectionSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
    static void
    selectionSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
    static short[]
    selectionSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
    static int
    shiftDown(short[] data, int size, int index, ShortComparator comp)
    Method to validate if the current value is the lowest value in the heap
    static int
    shiftUp(short[] data, int index, ShortComparator comp)
    Method to sort a specific value into the heap.
    static short[]
    shuffle(short[] array)
    Simple Shuffle method for Arrays.
    static short[]
    shuffle(short[] array, int length)
    Simple Shuffle method for Arrays.
    static short[]
    shuffle(short[] array, int offset, int length)
    Simple Shuffle method for Arrays.
    static short[]
    shuffle(short[] array, int offset, int length, RandomGenerator random)
    Simple Shuffle method for Arrays.
    static short[]
    shuffle(short[] array, int length, RandomGenerator random)
    Simple Shuffle method for Arrays.
    static short[]
    shuffle(short[] array, RandomGenerator random)
    Simple Shuffle method for Arrays.
    static short[]
    stableSort(short[] array)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    stableSort(short[] array, int length)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    stableSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    stableSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    stableSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static short[]
    stableSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static short[]
    unstableSort(short[] array)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    unstableSort(short[] array, int length)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    unstableSort(short[] array, int from, int to)
    Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    unstableSort(short[] array, int from, int to, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static void
    unstableSort(short[] array, int length, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static short[]
    unstableSort(short[] array, ShortComparator comp)
    Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array.
    static short[]
    A Helper function to convert a Short Array to a short Array.
    static short[]
    unwrap(Short[] a, int length)
    A Helper function to convert a Short Array to a short Array.
    static short[]
    unwrap(Short[] a, int offset, int length)
    A Helper function to convert a Short Array to a short Array.
    static Short[]
    wrap(short[] a)
    A Helper function to convert a Primitive Array to a Short Array.
    static Short[]
    wrap(short[] a, int length)
    A Helper function to convert a Primitive Array to a Short Array.
    static Short[]
    wrap(short[] a, int offset, int length)
    A Helper function to convert a Primitive Array to a Short Array.

    Von Klasse geerbte Methoden java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • BASE_THRESHOLD

      public static final int BASE_THRESHOLD
      Default Limit for Insertion/Selection Sort
      Siehe auch:
    • PARALLEL_THRESHOLD

      public static final int PARALLEL_THRESHOLD
      Default Threshold for Multithreaded Sorting Algorythm options
      Siehe auch:
    • EMPTY_ARRAY

      public static final short[] EMPTY_ARRAY
      Empty Array Reference used for Uninitialized Collections
  • Konstruktordetails

    • ShortArrays

      public ShortArrays()
  • Methodendetails

    • wrap

      public static Short[] wrap(short[] a)
      A Helper function to convert a Primitive Array to a Short Array.
      Parameter:
      a - the array that should be converted
      Gibt zurück:
      a Short Array of the input array.
    • wrap

      public static Short[] wrap(short[] a, int length)
      A Helper function to convert a Primitive Array to a Short Array.
      Parameter:
      a - the array that should be converted
      length - the maximum length that should be coverted
      Gibt zurück:
      a Short Array of the input array.
    • wrap

      public static Short[] wrap(short[] a, int offset, int length)
      A Helper function to convert a Primitive Array to a Short Array.
      Parameter:
      a - the array that should be converted
      offset - the starting offset of the inputarray
      length - the maximum length that should be coverted
      Gibt zurück:
      a Short Array of the input array.
    • unwrap

      public static short[] unwrap(Short[] a)
      A Helper function to convert a Short Array to a short Array.
      Parameter:
      a - the array that should be converted
      Gibt zurück:
      a short Array of the input array.
    • unwrap

      public static short[] unwrap(Short[] a, int length)
      A Helper function to convert a Short Array to a short Array.
      Parameter:
      a - the array that should be converted
      length - the maximum length that should be coverted
      Gibt zurück:
      a short Array of the input array.
    • unwrap

      public static short[] unwrap(Short[] a, int offset, int length)
      A Helper function to convert a Short Array to a short Array.
      Parameter:
      a - the array that should be converted
      offset - the starting offset of the inputarray
      length - the maximum length that should be coverted
      Gibt zurück:
      a short Array of the input array.
    • pour

      public static short[] pour(ShortIterator iter)
      A Helper function that pours all elements of a iterator into a Array
      Parameter:
      iter - the elements that should be gathered.
      Gibt zurück:
      array with all elements of the iterator
    • pour

      public static short[] pour(ShortIterator iter, int max)
      A Helper function that pours all elements of a iterator into a Array
      Parameter:
      iter - the elements that should be gathered.
      max - how many elements should be added
      Gibt zurück:
      array with all requested elements of the iterator
    • shiftDown

      public static int shiftDown(short[] data, int size, int index, ShortComparator comp)
      Method to validate if the current value is the lowest value in the heap
      Parameter:
      data - the current heap.
      size - the size of the heap
      index - the index that should be validated
      comp - the comparator to sort the heap. Can be null
      Gibt zurück:
      the index the element was shifted to
    • shiftUp

      public static int shiftUp(short[] data, int index, ShortComparator comp)
      Method to sort a specific value into the heap.
      Parameter:
      data - the heap itself.
      index - that should be heapified.
      comp - the comparator to sort the heap. Can be null
      Gibt zurück:
      the index the element was shifted to
    • heapify

      public static short[] heapify(short[] data, int size, ShortComparator comp)
      Helper function to create a Heap out of an array.
      Parameter:
      data - the array to heapify
      size - the current size of elements within the array.
      comp - the Comparator to sort the array. Can be null
      Gibt zurück:
      the input array
    • shuffle

      public static short[] shuffle(short[] array)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      Gibt zurück:
      the provided sorted array
      Note:
      This uses the SanityChecks#getRandom
    • shuffle

      public static short[] shuffle(short[] array, int length)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      length - the length of the array
      Gibt zurück:
      the provided sorted array
      Note:
      This uses the SanityChecks#getRandom
    • shuffle

      public static short[] shuffle(short[] array, int offset, int length)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      offset - the start array
      length - the length of the array
      Gibt zurück:
      the provided sorted array
      Note:
      This uses the SanityChecks#getRandom
    • shuffle

      public static short[] shuffle(short[] array, RandomGenerator random)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      random - the Random Number Generator that should be used for the shuffling
      Gibt zurück:
      the provided sorted array
    • shuffle

      public static short[] shuffle(short[] array, int length, RandomGenerator random)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      length - the length of the array
      random - the Random Number Generator that should be used for the shuffling
      Gibt zurück:
      the provided sorted array
    • shuffle

      public static short[] shuffle(short[] array, int offset, int length, RandomGenerator random)
      Simple Shuffle method for Arrays.
      Parameter:
      array - the elements that should be shuffled
      offset - the start array
      length - the length of the array
      random - the Random Number Generator that should be used for the shuffling
      Gibt zurück:
      the provided sorted array
    • reverse

      public static short[] reverse(short[] array)
      Simple Array Reversal method
      Parameter:
      array - the Array that should flip
      Gibt zurück:
      the provided array
    • reverse

      public static short[] reverse(short[] array, int length)
      Simple Array Reversal method
      Parameter:
      array - the Array that should flip
      length - the length of the array
      Gibt zurück:
      the provided array
    • reverse

      public static short[] reverse(short[] array, int offset, int length)
      Simple Array Reversal method
      Parameter:
      array - the Array that should flip
      offset - the start of the array
      length - the length of the array
      Gibt zurück:
      the provided array
    • stableSort

      public static short[] stableSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array.
    • stableSort

      public static void stableSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • stableSort

      public static void stableSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • stableSort

      public static short[] stableSort(short[] array)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • stableSort

      public static void stableSort(short[] array, int length)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • stableSort

      public static void stableSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Stable sort referres to Mergesort or Insertionsort
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • unstableSort

      public static short[] unstableSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array
    • unstableSort

      public static void unstableSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • unstableSort

      public static void unstableSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • unstableSort

      public static short[] unstableSort(short[] array)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • unstableSort

      public static void unstableSort(short[] array, int length)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • unstableSort

      public static void unstableSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order, potentially dynamically choosing an appropriate algorithm given the type and size of the array. Unstable sort referres to QuickSort or SelectionSort
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • insertionSort

      public static short[] insertionSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array
    • insertionSort

      public static void insertionSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • insertionSort

      public static void insertionSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • insertionSort

      public static short[] insertionSort(short[] array)
      Sorts an array according to the natural ascending order using InsertionSort,
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • insertionSort

      public static void insertionSort(short[] array, int length)
      Sorts an array according to the natural ascending order using InsertionSort,
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • insertionSort

      public static void insertionSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using InsertionSort,
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • selectionSort

      public static short[] selectionSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array
    • selectionSort

      public static void selectionSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • selectionSort

      public static void selectionSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • selectionSort

      public static short[] selectionSort(short[] array)
      Sorts an array according to the natural ascending order using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • selectionSort

      public static void selectionSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • selectionSort

      public static void selectionSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using Selection Sort,
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • mergeSort

      public static short[] mergeSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array
    • mergeSort

      public static void mergeSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • mergeSort

      public static void mergeSort(short[] array, short[] supp, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      supp - the auxillary array that is used to simplify the sorting
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • mergeSort

      public static short[] mergeSort(short[] array)
      Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • mergeSort

      public static void mergeSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • mergeSort

      public static void mergeSort(short[] array, short[] supp, int from, int to)
      Sorts an array according to the natural ascending order using Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      supp - the auxillary array that is used to simplify the sorting
      from - where the array should be sorted from
      to - where the array should be sorted to
    • parallelMergeSort

      public static void parallelMergeSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using a Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMergeSort

      public static void parallelMergeSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMergeSort

      public static void parallelMergeSort(short[] array, short[] supp, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      supp - the auxillary array that is used to simplify the sorting
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMergeSort

      public static void parallelMergeSort(short[] array)
      Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMergeSort

      public static void parallelMergeSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMergeSort

      public static void parallelMergeSort(short[] array, short[] supp, int from, int to)
      Sorts an array according to the natural ascending order using Parallel Merge Sort, This implementation was copied from FastUtil with a couple custom optimizations
      Parameter:
      array - the array that needs to be sorted
      supp - the auxillary array that is used to simplify the sorting
      from - where the array should be sorted from
      to - where the array should be sorted to
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • memFreeMergeSort

      public static void memFreeMergeSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is in Very Unsorted Instances 50% slower then Mergesort, otherwise it as fast.
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
    • memFreeMergeSort

      public static void memFreeMergeSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is in Very Unsorted Instances 50% slower then Mergesort, otherwise it as fast.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • memFreeMergeSort

      public static void memFreeMergeSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is in Very Unsorted Instances 50% slower then Mergesort, otherwise it as fast.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • memFreeMergeSort

      public static short[] memFreeMergeSort(short[] array)
      Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • memFreeMergeSort

      public static void memFreeMergeSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • memFreeMergeSort

      public static void memFreeMergeSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array)
      Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelMemFreeMergeSort

      public static void parallelMemFreeMergeSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using Parallel Memory Free Merge Sort, This implementation is inspired by FastUtil original merge sort, but without the need to allocate a copy of the original Array. It is depending on the size and the unsorted level of the input array slower or almost as fast as normal merge sort. Depending on the test size i can be 0.5x slower (5000 elements) or 4x slower (50000 elements) under the assumtion that the array is in its worst case scenario. It does stack allocate tiny amounts of data for shifting around elements.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • quickSort

      public static short[] quickSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Gibt zurück:
      input array
    • quickSort

      public static void quickSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
    • quickSort

      public static void quickSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
    • quickSort

      public static short[] quickSort(short[] array)
      Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      Gibt zurück:
      input array
    • quickSort

      public static void quickSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
    • quickSort

      public static void quickSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
    • parallelQuickSort

      public static void parallelQuickSort(short[] array, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelQuickSort

      public static void parallelQuickSort(short[] array, int length, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelQuickSort

      public static void parallelQuickSort(short[] array, int from, int to, ShortComparator comp)
      Sorts the specified range of elements according to the order induced by the specified comparator using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      comp - the Comparator that decides the sorting order
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelQuickSort

      public static void parallelQuickSort(short[] array)
      Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelQuickSort

      public static void parallelQuickSort(short[] array, int length)
      Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      length - the maxmium size of the array to be sorted
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed
    • parallelQuickSort

      public static void parallelQuickSort(short[] array, int from, int to)
      Sorts an array according to the natural ascending order using Parallel Quick Sort, This implementation is a custom of FastUtil quicksort but with a different code structure, and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
      Parameter:
      array - the array that needs to be sorted
      from - where the array should be sorted from
      to - where the array should be sorted to
      Note:
      This parallelization is invoked through SanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed