| Modifier and Type | Method and Description |
|---|---|
static double[] |
concat(double[]... arrays)
Concats the given arrays.
|
static int[] |
concat(int[]... arrays)
Concats the given arrays.
|
static long[] |
concat(long[]... arrays)
Concats the given arrays.
|
static <T> T[] |
concat(T[]... arrays)
Concats the given arrays.
|
static double[] |
copy(double[] array)
Copies the given array into a new one.
|
static int[] |
copy(int[] array)
Copies the given array into a new one.
|
static long[] |
copy(long[] array)
Copies the given array into a new one.
|
static <T> T[] |
copy(T[] array)
Copies the given array into a new one.
|
static void |
countingSort(int[] a,
int low,
int high)
Counting sort that sorts the integer array in O(n+k) where n is the number
of elements and k is the length of the integer intervals given (high -
low).
|
static byte[] |
create(byte... arrays)
Creates the given array from a varargs parameter.
|
static double[] |
create(double... arrays)
Creates the given array from a varargs parameter.
|
static int[] |
create(int... arrays)
Creates the given array from a varargs parameter.
|
static long[] |
create(long... arrays)
Creates the given array from a varargs parameter.
|
static <T> T[] |
create(T... arrays)
Creates the given array from a varargs parameter.
|
static int[] |
deduplicate(int[] arr)
Deduplicates an array in linear time, it does not change the order of the
elements.
|
static <T> ArrayList<T> |
deduplicate(T[] arr)
Deduplicates an array in linear time, it does not change the order of the
elements.
|
static int |
find(int[] array,
int key)
Finds the occurence of the given key in the given array.
|
static int |
find(long[] array,
long key)
Finds the occurence of the given key in the given array.
|
static <T> int |
find(T[] array,
T key)
Finds the occurence of the given key in the given array.
|
static double[] |
fromUpTo(double from,
double to,
double stepsize)
Creates a double array from the given start up to a end number with a
stepsize.
|
static int[] |
fromUpTo(int from,
int to,
int stepsize)
Creates an integer array from the given start up to a end number with a
stepsize.
|
static long[] |
fromUpTo(long from,
long to,
long stepsize)
Creates a long array from the given start up to a end number with a
stepsize.
|
static int[] |
intersection(int[] arr,
int[] arr2)
Computes the intersection of two sorted arrays.
|
static int[] |
intersectionUnsorted(int[] arr,
int[] arr2)
Computes the intersection of two unsorted arrays.
|
static boolean |
isValidIndex(boolean[] array,
int index) |
static boolean |
isValidIndex(byte[] array,
int index) |
static boolean |
isValidIndex(double[] array,
int index) |
static boolean |
isValidIndex(float[] array,
int index) |
static boolean |
isValidIndex(int[] array,
int index) |
static boolean |
isValidIndex(long[] array,
int index) |
static <T> boolean |
isValidIndex(T[] array,
int index) |
static double |
max(double[] array) |
static int |
max(int[] array) |
static long |
max(long[] array) |
static int |
maxIndex(double[] array) |
static int |
maxIndex(int[] array) |
static int |
maxIndex(long[] array) |
static int |
medianOfMedians(int[] array)
Finds the median of medians in the given array.
|
static int[] |
merge(int[] a,
int[] b)
Merges two sorted arrays to a single new array.
|
static void |
merge(int[] numbers,
int startIndexA,
int endIndexA,
int endIndexB)
Merges two sorted subparts of the given number array.
|
static double |
min(double[] array) |
static int |
min(int[] array) |
static long |
min(long[] array) |
static int |
minIndex(double[] array) |
static int |
minIndex(int[] array) |
static int |
minIndex(long[] array) |
static int |
missingNumber(int[] array)
If array contains unique integers in a range between 0 and n-1, this
function finds the only one missing in linear time and constant memory.
|
static void |
multiQuickSort(int[]... arrays)
Multi-sorts the given arrays with the quicksort algorithm.
|
static void |
multiQuickSort(int sortDimension,
int[]... arrays)
Multi-sorts the given arrays with the quicksort algorithm.
|
static <T extends Comparable<T>> |
multiQuickSort(int sortDimension,
T[]... arrays)
Multi-sorts the given arrays with the quicksort algorithm.
|
static <T extends Comparable<T>> |
multiQuickSort(T[]... arrays)
Multi-sorts the given arrays with the quicksort algorithm.
|
static <T> T[] |
multiShuffle(T[] array,
Random rnd,
T[]... additions)
Shuffles the given array with the given random function.
|
static <T> T[] |
multiShuffle(T[] array,
T[]... additions)
Shuffles the given array.
|
static int |
partition(double[] array)
Partitions the given array in-place and uses the last element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
partition(double[] array,
int start,
int end)
Partitions the given array in-place and uses the end element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
partition(int[] array)
Partitions the given array in-place and uses the last element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
partition(int[] array,
int start,
int end)
Partitions the given array in-place and uses the end element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
partition(long[] array)
Partitions the given array in-place and uses the last element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
partition(long[] array,
int start,
int end)
Partitions the given array in-place and uses the end element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static <T extends Comparable<T>> |
partition(T[] array)
Partitions the given array in-place and uses the last element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static <T extends Comparable<T>> |
partition(T[] array,
int start,
int end)
Partitions the given array in-place and uses the end element as pivot,
everything less than the pivot will be placed left and everything greater
will be placed right of the pivot.
|
static int |
quickSelect(double[] array,
int k)
Selects the kth smallest element in the array in linear time.
|
static int |
quickSelect(double[] array,
int start,
int end,
int k)
Selects the kth smallest element in the array.
|
static int |
quickSelect(int[] array,
int k)
Selects the kth smallest element in the array in linear time, if the array
is smaller than or equal to 10 a radix sort will be used and the kth
element will be returned.
|
static int |
quickSelect(int[] array,
int start,
int end,
int k)
Selects the kth smallest element in the array.
|
static int |
quickSelect(long[] array,
int k)
Selects the kth smallest element in the array in linear time.
|
static int |
quickSelect(long[] array,
int start,
int end,
int k)
Selects the kth smallest element in the array.
|
static <T extends Comparable<T>> |
quickSelect(T[] array,
int k)
Selects the kth smallest element in the array in linear time.
|
static <T extends Comparable<T>> |
quickSelect(T[] array,
int start,
int end,
int k)
Selects the kth smallest element in the array.
|
static void |
quickSort(double[] a)
Quicksorts this array.
|
static void |
quickSort(double[] a,
int offset,
int length)
Quicksorts this array.
|
static void |
quickSort(int[] a)
Quicksorts this array.
|
static void |
quickSort(int[] a,
int offset,
int length)
Quicksorts this array.
|
static void |
quickSort(long[] a)
Quicksorts this array.
|
static void |
quickSort(long[] a,
int offset,
int length)
Quicksorts this array.
|
static <T extends Comparable<T>> |
quickSort(T[] a)
Quicksorts this array.
|
static <T extends Comparable<T>> |
quickSort(T[] a,
int offset,
int length)
Quicksorts this array.
|
static void |
radixSort(int[] a)
Radix sorts an integer array in O(m*n), where m is the length of the key
(here 32 bit) and n the number of elements.
|
static <T> T[] |
shuffle(T[] array)
Shuffles the given array.
|
static <T> T[] |
shuffle(T[] array,
Random rnd)
Shuffles the given array with the given random function.
|
static <T> T[] |
subArray(T[] array,
int splitIndex)
Splits the given array from 0 to the given splitindex (included).
|
static <T> T[] |
subArray(T[] array,
int startIndex,
int splitIndex)
Splits the given array from the given startIndex to the given splitIndex
(included).
|
static void |
swap(boolean[] array,
int x,
int y)
Swaps the given index x with y in the array.
|
static void |
swap(double[] array,
int x,
int y)
Swaps the given index x with y in the array.
|
static void |
swap(int[] array,
int x,
int y)
Swaps the given index x with y in the array.
|
static void |
swap(long[] array,
int x,
int y)
Swaps the given index x with y in the array.
|
static <T> void |
swap(T[] array,
int x,
int y)
Swaps the given index x with y in the array.
|
static List<Double> |
toObjectList(double[] array)
Converts the given double array to a list of object wrappers.
|
static List<Integer> |
toObjectList(int[] array)
Converts the given int array to a list of object wrappers.
|
static List<Long> |
toObjectList(long[] array)
Converts the given long array to a list of object wrappers.
|
static double[] |
toPrimitiveArray(Double[] array)
Converts the given array of object type to its primitive counterpart.
|
static int[] |
toPrimitiveArray(Integer[] array)
Converts the given array of object type to its primitive counterpart.
|
static int[] |
toPrimitiveArray(List<Integer> list)
Converts the given list of object type to its primitive counterpart.
|
static long[] |
toPrimitiveArray(Long[] array)
Converts the given array of object type to its primitive counterpart.
|
static int[] |
union(int[] a,
int[] b)
Computes the union of two arrays.
|
public static <T> int find(T[] array,
T key)
array - the array to search.key - the key to search.public static int find(int[] array,
int key)
array - the array to search.key - the key to search.public static int find(long[] array,
long key)
array - the array to search.key - the key to search.public static int[] concat(int[]... arrays)
arrays - the arrays to pass.public static long[] concat(long[]... arrays)
arrays - the arrays to pass.public static double[] concat(double[]... arrays)
arrays - the arrays to pass.public static <T> T[] concat(T[]... arrays)
arrays - the arrays to pass.public static int[] copy(int[] array)
public static double[] copy(double[] array)
public static long[] copy(long[] array)
public static <T> T[] copy(T[] array)
public static void swap(int[] array,
int x,
int y)
public static void swap(long[] array,
int x,
int y)
public static void swap(double[] array,
int x,
int y)
public static void swap(boolean[] array,
int x,
int y)
public static <T> void swap(T[] array,
int x,
int y)
public static int[] toPrimitiveArray(List<Integer> list)
public static int[] toPrimitiveArray(Integer[] array)
public static long[] toPrimitiveArray(Long[] array)
public static double[] toPrimitiveArray(Double[] array)
public static List<Integer> toObjectList(int[] array)
public static List<Long> toObjectList(long[] array)
public static List<Double> toObjectList(double[] array)
public static <T extends Comparable<T>> int partition(T[] array)
public static <T extends Comparable<T>> int partition(T[] array, int start, int end)
public static int partition(int[] array)
public static int partition(int[] array,
int start,
int end)
public static int partition(long[] array)
public static int partition(long[] array,
int start,
int end)
public static int partition(double[] array)
public static int partition(double[] array,
int start,
int end)
public static int quickSelect(int[] array,
int k)
public static int quickSelect(int[] array,
int start,
int end,
int k)
start - the index where to start.end - the index where to end.public static int quickSelect(double[] array,
int k)
public static int quickSelect(double[] array,
int start,
int end,
int k)
start - the index where to start.end - the index where to end.public static int quickSelect(long[] array,
int k)
public static int quickSelect(long[] array,
int start,
int end,
int k)
start - the index where to start.end - the index where to end.public static <T extends Comparable<T>> int quickSelect(T[] array, int k)
public static <T extends Comparable<T>> int quickSelect(T[] array, int start, int end, int k)
start - the index where to start.end - the index where to end.public static int medianOfMedians(int[] array)
public static int[] fromUpTo(int from,
int to,
int stepsize)
from - the integer to start with.to - the integer to end with.stepsize - the stepsize to takepublic static long[] fromUpTo(long from,
long to,
long stepsize)
from - the long to start with.to - the long to end with.stepsize - the stepsize to takepublic static double[] fromUpTo(double from,
double to,
double stepsize)
from - the double to start with.to - the double to end with.stepsize - the stepsize to takepublic static void radixSort(int[] a)
public static void countingSort(int[] a,
int low,
int high)
public static void quickSort(int[] a)
public static void quickSort(int[] a,
int offset,
int length)
public static void quickSort(long[] a)
public static void quickSort(long[] a,
int offset,
int length)
public static void quickSort(double[] a)
public static void quickSort(double[] a,
int offset,
int length)
public static <T extends Comparable<T>> void quickSort(T[] a)
public static <T extends Comparable<T>> void quickSort(T[] a, int offset, int length)
public static void multiQuickSort(int[]... arrays)
Arrays sort;public static void multiQuickSort(int sortDimension,
int[]... arrays)
Arrays sort;@SafeVarargs public static <T extends Comparable<T>> void multiQuickSort(T[]... arrays)
Arrays sort;@SafeVarargs public static <T extends Comparable<T>> void multiQuickSort(int sortDimension, T[]... arrays)
Arrays sort;public static int[] deduplicate(int[] arr)
public static <T> ArrayList<T> deduplicate(T[] arr)
public static int[] union(int[] a,
int[] b)
public static int[] intersection(int[] arr,
int[] arr2)
public static int[] intersectionUnsorted(int[] arr,
int[] arr2)
public static int missingNumber(int[] array)
public static int min(int[] array)
public static int minIndex(int[] array)
public static long min(long[] array)
public static int minIndex(long[] array)
public static double min(double[] array)
public static int minIndex(double[] array)
public static int max(int[] array)
public static int maxIndex(int[] array)
public static long max(long[] array)
public static int maxIndex(long[] array)
public static double max(double[] array)
public static int maxIndex(double[] array)
public static <T> T[] subArray(T[] array,
int splitIndex)
public static <T> T[] subArray(T[] array,
int startIndex,
int splitIndex)
public static <T> T[] shuffle(T[] array)
public static <T> T[] shuffle(T[] array,
Random rnd)
@SafeVarargs public static <T> T[] multiShuffle(T[] array, T[]... additions)
@SafeVarargs public static <T> T[] multiShuffle(T[] array, Random rnd, T[]... additions)
public static int[] create(int... arrays)
arrays - the array to create.public static long[] create(long... arrays)
arrays - the array to create.public static double[] create(double... arrays)
arrays - the array to create.public static byte[] create(byte... arrays)
arrays - the array to create.@SafeVarargs public static <T> T[] create(T... arrays)
arrays - the array to create.public static int[] merge(int[] a,
int[] b)
a - sorted array.b - sorted array.public static void merge(int[] numbers,
int startIndexA,
int endIndexA,
int endIndexB)
numbers - the array which has two sorted sub arrays.startIndexA - the start index of the first sorted array.endIndexA - the end index of the first sorted array.endIndexB - the end of the second array.public static boolean isValidIndex(int[] array,
int index)
public static boolean isValidIndex(double[] array,
int index)
public static boolean isValidIndex(float[] array,
int index)
public static boolean isValidIndex(long[] array,
int index)
public static boolean isValidIndex(boolean[] array,
int index)
public static boolean isValidIndex(byte[] array,
int index)
public static <T> boolean isValidIndex(T[] array,
int index)
Copyright © 2016. All rights reserved.