public class ObjectArrays
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BASE_THRESHOLD
Default Limit for Insertion/Selection Sort
|
static java.lang.Object[] |
EMPTY_ARRAY
Empty Array Reference used for Uninitialized Collections
|
static int |
PARALLEL_THRESHOLD
Default Threshold for Multithreaded Sorting Algorythm options
|
| Constructor and Description |
|---|
ObjectArrays() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
heapify(T[] data,
int size,
java.util.Comparator<? super T> comp)
Helper function to create a Heap out of an array.
|
static <T extends java.lang.Comparable<T>> |
insertionSort(T[] array)
Sorts an array according to the natural ascending order using InsertionSort,
|
static <T> void |
insertionSort(T[] array,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
|
static <T extends java.lang.Comparable<T>> |
insertionSort(T[] array,
int length)
Sorts an array according to the natural ascending order using InsertionSort,
|
static <T> void |
insertionSort(T[] array,
int length,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
|
static <T extends java.lang.Comparable<T>> |
insertionSort(T[] array,
int from,
int to)
Sorts an array according to the natural ascending order using InsertionSort,
|
static <T> void |
insertionSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Insertion Sort,
|
static <T extends java.lang.Comparable<T>> |
memFreeMergeSort(T[] 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 <T> void |
memFreeMergeSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
memFreeMergeSort(T[] 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 <T> void |
memFreeMergeSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
memFreeMergeSort(T[] 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 <T> void |
memFreeMergeSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
mergeSort(T[] 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 <T> void |
mergeSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
mergeSort(T[] 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 <T> void |
mergeSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
mergeSort(T[] array,
T[] 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 <T> void |
mergeSort(T[] array,
T[] supp,
int from,
int to,
java.util.Comparator<T> 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 <T> T[] |
newArray(java.lang.Class<T> clz,
int length)
Function to create a new Array of a given size
|
static <T extends java.lang.Comparable<T>> |
parallelMemFreeMergeSort(T[] 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 <T> void |
parallelMemFreeMergeSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelMemFreeMergeSort(T[] 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 <T> void |
parallelMemFreeMergeSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelMemFreeMergeSort(T[] 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 <T> void |
parallelMemFreeMergeSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelMergeSort(T[] 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 <T> void |
parallelMergeSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelMergeSort(T[] 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 <T> void |
parallelMergeSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelMergeSort(T[] array,
T[] 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 <T> void |
parallelMergeSort(T[] array,
T[] supp,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelQuickSort(T[] 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 <T> void |
parallelQuickSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelQuickSort(T[] 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 <T> void |
parallelQuickSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
parallelQuickSort(T[] 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 <T> void |
parallelQuickSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
quickSort(T[] 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 <T> void |
quickSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
quickSort(T[] 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 <T> void |
quickSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
quickSort(T[] 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 <T> void |
quickSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
selectionSort(T[] array)
Sorts an array according to the natural ascending order using Selection Sort,
|
static <T> void |
selectionSort(T[] array,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
|
static <T extends java.lang.Comparable<T>> |
selectionSort(T[] array,
int length)
Sorts an array according to the natural ascending order using Selection Sort,
|
static <T> void |
selectionSort(T[] array,
int length,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
|
static <T extends java.lang.Comparable<T>> |
selectionSort(T[] array,
int from,
int to)
Sorts an array according to the natural ascending order using Selection Sort,
|
static <T> void |
selectionSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
Sorts the specified range of elements according to the order induced by the specified comparator using Selection Sort,
|
static <T> int |
shiftDown(T[] data,
int size,
int index,
java.util.Comparator<? super T> comp)
Method to validate if the current value is the lowest value in the heap
|
static <T> int |
shiftUp(T[] data,
int index,
java.util.Comparator<? super T> comp)
Method to sort a specific value into the heap.
|
static <T> T[] |
shuffle(T[] array)
Simple Shuffle method for Arrays.
|
static <T> T[] |
shuffle(T[] array,
java.util.Random random)
Simple Shuffle method for Arrays.
|
static <T extends java.lang.Comparable<T>> |
stableSort(T[] 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 <T> void |
stableSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
stableSort(T[] 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 <T> void |
stableSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
stableSort(T[] 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 <T> void |
stableSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
unstableSort(T[] 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 <T> void |
unstableSort(T[] array,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
unstableSort(T[] 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 <T> void |
unstableSort(T[] array,
int length,
java.util.Comparator<T> 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 <T extends java.lang.Comparable<T>> |
unstableSort(T[] 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 <T> void |
unstableSort(T[] array,
int from,
int to,
java.util.Comparator<T> 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.
|
public static final int BASE_THRESHOLD
public static final int PARALLEL_THRESHOLD
public static final java.lang.Object[] EMPTY_ARRAY
public static <T> T[] newArray(java.lang.Class<T> clz,
int length)
T - the type of array that the operation should be appliedclz - the class type of array that is requestedlength - the lenght the array should be.public static <T> int shiftDown(T[] data,
int size,
int index,
java.util.Comparator<? super T> comp)
T - the type of array that the operation should be applieddata - the current heap.size - the size of the heapindex - the index that should be validatedcomp - the comparator to sort the heap. Can be nullpublic static <T> int shiftUp(T[] data,
int index,
java.util.Comparator<? super T> comp)
T - the type of array that the operation should be applieddata - the heap itself.index - that should be heapified.comp - the comparator to sort the heap. Can be nullpublic static <T> T[] heapify(T[] data,
int size,
java.util.Comparator<? super T> comp)
T - the type of array that the operation should be applieddata - the array to heapifysize - the current size of elements within the array.comp - the Comparator to sort the array. Can be nullpublic static <T> T[] shuffle(T[] array)
T - the type of array that the operation should be appliedarray - the elements that should be shuffledpublic static <T> T[] shuffle(T[] array,
java.util.Random random)
T - the type of array that the operation should be appliedarray - the elements that should be shuffledrandom - the Random Number Generator that should be used for the shufflingpublic static <T> void stableSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void stableSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void stableSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void stableSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void stableSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void stableSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void unstableSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void unstableSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void unstableSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void unstableSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void unstableSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void unstableSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void insertionSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void insertionSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void insertionSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void insertionSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void insertionSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void insertionSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void selectionSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void selectionSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void selectionSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void selectionSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void selectionSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void selectionSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void mergeSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void mergeSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void mergeSort(T[] array,
T[] supp,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedsupp - the auxillary array that is used to simplify the sortingfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void mergeSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void mergeSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void mergeSort(T[] array,
T[] supp,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedsupp - the auxillary array that is used to simplify the sortingfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void parallelMergeSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelMergeSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelMergeSort(T[] array,
T[] supp,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedsupp - the auxillary array that is used to simplify the sortingfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMergeSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMergeSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMergeSort(T[] array,
T[] supp,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedsupp - the auxillary array that is used to simplify the sortingfrom - where the array should be sorted fromto - where the array should be sorted toSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void memFreeMergeSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void memFreeMergeSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void memFreeMergeSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void memFreeMergeSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void memFreeMergeSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void memFreeMergeSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void parallelMemFreeMergeSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelMemFreeMergeSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelMemFreeMergeSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMemFreeMergeSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMemFreeMergeSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelMemFreeMergeSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted toSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void quickSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void quickSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderpublic static <T> void quickSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderpublic static <T extends java.lang.Comparable<T>> void quickSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T extends java.lang.Comparable<T>> void quickSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedpublic static <T extends java.lang.Comparable<T>> void quickSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted topublic static <T> void parallelQuickSort(T[] array,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelQuickSort(T[] array,
int length,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedcomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T> void parallelQuickSort(T[] array,
int from,
int to,
java.util.Comparator<T> comp)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted tocomp - the Comparator that decides the sorting orderSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelQuickSort(T[] array)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelQuickSort(T[] array,
int length)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedlength - the maxmium size of the array to be sortedSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as neededpublic static <T extends java.lang.Comparable<T>> void parallelQuickSort(T[] array,
int from,
int to)
T - the type of array that the operation should be appliedarray - the array that needs to be sortedfrom - where the array should be sorted fromto - where the array should be sorted toSanityChecks.invokeTask(java.util.concurrent.ForkJoinTask<T>) which the threadpool can be changed as needed