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> T[] |
insertionSort(T[] array)
Sorts an array according to the natural ascending order using InsertionSort,
|
static <T> T[] |
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> void |
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> void |
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> 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> void |
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> void |
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> 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> T[] |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> void |
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> T[] |
pour(ObjectIterator<T> iter)
A Helper function that pours all elements of a iterator into a Array
|
static <T> T[] |
pour(ObjectIterator<T> iter,
int max)
A Helper function that pours all elements of a iterator into a Array
|
static <T,E> E[] |
pour(ObjectIterator<T> iter,
java.util.function.IntFunction<E[]> action)
A Helper function that pours all elements of a iterator into a Array
|
static <T,E> E[] |
pour(ObjectIterator<T> iter,
int max,
java.util.function.IntFunction<E[]> action)
A Helper function that pours all elements of a iterator into a Array
|
static <T> 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> T[] |
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> void |
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> void |
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> T[] |
reverse(T[] array)
Simple Array Reversal method
|
static <T> T[] |
reverse(T[] array,
int length)
Simple Array Reversal method
|
static <T> T[] |
reverse(T[] array,
int offset,
int length)
Simple Array Reversal method
|
static <T> T[] |
selectionSort(T[] array)
Sorts an array according to the natural ascending order using Selection Sort,
|
static <T> T[] |
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> void |
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> void |
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,
int length)
Simple Shuffle method for Arrays.
|
static <T> T[] |
shuffle(T[] array,
int offset,
int length)
Simple Shuffle method for Arrays.
|
static <T> T[] |
shuffle(T[] array,
int offset,
int length,
java.util.Random random)
Simple Shuffle method for Arrays.
|
static <T> T[] |
shuffle(T[] array,
int length,
java.util.Random random)
Simple Shuffle method for Arrays.
|
static <T> T[] |
shuffle(T[] array,
java.util.Random random)
Simple Shuffle method for Arrays.
|
static <T> 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> T[] |
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> void |
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> void |
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> 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> T[] |
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> void |
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> void |
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 keyType 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> T[] pour(ObjectIterator<T> iter)
T - the keyType of array that the operation should be appliediter - the elements that should be gathered.public static <T> T[] pour(ObjectIterator<T> iter, int max)
T - the keyType of array that the operation should be appliediter - the elements that should be gathered.max - how many elements should be addedpublic static <T,E> E[] pour(ObjectIterator<T> iter, java.util.function.IntFunction<E[]> action)
T - the keyType of array that the operation should be appliediter - the elements that should be gathered.action - that is creating the Array to be poured intopublic static <T,E> E[] pour(ObjectIterator<T> iter, int max, java.util.function.IntFunction<E[]> action)
T - the keyType of array that the operation should be appliediter - the elements that should be gathered.max - how many elements should be addedaction - that is creating the Array to be poured intopublic static <T> int shiftDown(T[] data,
int size,
int index,
java.util.Comparator<? super T> comp)
T - the keyType 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 keyType 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 keyType 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 keyType of array that the operation should be appliedarray - the elements that should be shuffledpublic static <T> T[] shuffle(T[] array,
int length)
T - the keyType of array that the operation should be appliedarray - the elements that should be shuffledlength - the length of the arraypublic static <T> T[] shuffle(T[] array,
int offset,
int length)
T - the keyType of array that the operation should be appliedarray - the elements that should be shuffledoffset - the start arraylength - the length of the arraypublic static <T> T[] shuffle(T[] array,
java.util.Random random)
T - the keyType 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> T[] shuffle(T[] array,
int length,
java.util.Random random)
T - the keyType of array that the operation should be appliedarray - the elements that should be shuffledlength - the length of the arrayrandom - the Random Number Generator that should be used for the shufflingpublic static <T> T[] shuffle(T[] array,
int offset,
int length,
java.util.Random random)
T - the keyType of array that the operation should be appliedarray - the elements that should be shuffledoffset - the start arraylength - the length of the arrayrandom - the Random Number Generator that should be used for the shufflingpublic static <T> T[] reverse(T[] array)
T - the keyType of array that the operation should be appliedarray - the Array that should flippublic static <T> T[] reverse(T[] array,
int length)
T - the keyType of array that the operation should be appliedarray - the Array that should fliplength - the length of the arraypublic static <T> T[] reverse(T[] array,
int offset,
int length)
T - the keyType of array that the operation should be appliedarray - the Array that should fliplength - the length of the arrayoffset - the start of the arraypublic static <T> T[] stableSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] stableSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void stableSort(T[] array,
int length)
T - the keyType 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> void stableSort(T[] array,
int from,
int to)
T - the keyType 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> T[] unstableSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] unstableSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void unstableSort(T[] array,
int length)
T - the keyType 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> void unstableSort(T[] array,
int from,
int to)
T - the keyType 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> T[] insertionSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] insertionSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void insertionSort(T[] array,
int length)
T - the keyType 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> void insertionSort(T[] array,
int from,
int to)
T - the keyType 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> T[] selectionSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] selectionSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void selectionSort(T[] array,
int length)
T - the keyType 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> void selectionSort(T[] array,
int from,
int to)
T - the keyType 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> T[] mergeSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] mergeSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void mergeSort(T[] array,
int length)
T - the keyType 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> void mergeSort(T[] array,
T[] supp,
int from,
int to)
T - the keyType 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 keyType 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 keyType 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 keyType 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> void parallelMergeSort(T[] array)
T - the keyType 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> void parallelMergeSort(T[] array,
int length)
T - the keyType 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> void parallelMergeSort(T[] array,
T[] supp,
int from,
int to)
T - the keyType 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 keyType 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 keyType 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 keyType 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> T[] memFreeMergeSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void memFreeMergeSort(T[] array,
int length)
T - the keyType 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> void memFreeMergeSort(T[] array,
int from,
int to)
T - the keyType 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 keyType 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 keyType 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 keyType 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> void parallelMemFreeMergeSort(T[] array)
T - the keyType 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> void parallelMemFreeMergeSort(T[] array,
int length)
T - the keyType 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> void parallelMemFreeMergeSort(T[] array,
int from,
int to)
T - the keyType 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> T[] quickSort(T[] array,
java.util.Comparator<T> comp)
T - the keyType 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 keyType 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 keyType 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> T[] quickSort(T[] array)
T - the keyType of array that the operation should be appliedarray - the array that needs to be sortedpublic static <T> void quickSort(T[] array,
int length)
T - the keyType 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> void quickSort(T[] array,
int from,
int to)
T - the keyType 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 keyType 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 keyType 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 keyType 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> void parallelQuickSort(T[] array)
T - the keyType 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> void parallelQuickSort(T[] array,
int length)
T - the keyType 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> void parallelQuickSort(T[] array,
int from,
int to)
T - the keyType 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