|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.chars.CharArrays
public class CharArrays
A class providing static methods and objects that do useful things with type-specific arrays.
In particular, the ensureCapacity()
, grow()
,
trim()
and setLength()
methods allow to handle
arrays much like array lists. This can be very useful when efficiency (or
syntactic simplicity) reasons make array lists unsuitable.
Note that BinIO
and TextIO
contain several methods make it possible to load and save arrays of primitive types as sequences
of elements in DataInput
format (i.e., not as objects) or as sequences of lines of text.
Arrays
Field Summary | |
---|---|
static char[] |
EMPTY_ARRAY
A static, final, empty array. |
static Hash.Strategy |
HASH_STRATEGY
A type-specific content-based hash strategy for arrays. |
static long |
ONEOVERPHI
The inverse of the golden ratio times 216. |
Method Summary | |
---|---|
static int |
binarySearch(char[] a,
char key)
Searches an array for the specified value using the binary search algorithm. |
static int |
binarySearch(char[] a,
char key,
CharComparator c)
Searches an array for the specified value using the binary search algorithm and a specified comparator. |
static int |
binarySearch(char[] a,
int from,
int to,
char key)
Searches a range of the specified array for the specified value using the binary search algorithm. |
static int |
binarySearch(char[] a,
int from,
int to,
char key,
CharComparator c)
Searches a range of the specified array for the specified value using the binary search algorithm and a specified comparator. |
static char[] |
copy(char[] array)
Returns a copy of an array. |
static char[] |
copy(char[] array,
int offset,
int length)
Returns a copy of a portion of an array. |
static char[] |
ensureCapacity(char[] array,
int length)
Ensures that an array can contain the given number of entries. |
static char[] |
ensureCapacity(char[] array,
int length,
int preserve)
Ensures that an array can contain the given number of entries, preserving just a part of the array. |
static void |
ensureFromTo(char[] a,
int from,
int to)
Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array. |
static void |
ensureOffsetLength(char[] a,
int offset,
int length)
Ensures that a range given by an offset and a length fits an array. |
static boolean |
equals(char[] a1,
char[] a2)
Returns true if the two arrays are elementwise equal. |
static void |
fill(char[] array,
char value)
Fills the given array with the given value. |
static void |
fill(char[] array,
int from,
int to,
char value)
Fills a portion of the given array with the given value. |
static char[] |
grow(char[] array,
int length)
Grows the given array to the maximum between the given length and the current length divided by the golden ratio, provided that the given length is larger than the current length. |
static char[] |
grow(char[] array,
int length,
int preserve)
Grows the given array to the maximum between the given length and the current length divided by the golden ratio, provided that the given length is larger than the current length, preserving just a part of the array. |
static void |
mergeSort(char[] a)
Sorts an array according to the natural ascending order using mergesort. |
static void |
mergeSort(char[] a,
CharComparator comp)
Sorts an array according to the order induced by the specified comparator using mergesort. |
static void |
mergeSort(char[] a,
int from,
int to)
Sorts the specified range of elements according to the natural ascending order using mergesort. |
static void |
mergeSort(char[] a,
int from,
int to,
char[] supp)
Sorts the specified range of elements according to the natural ascending order using mergesort, using a given support array. |
static void |
mergeSort(char[] a,
int from,
int to,
CharComparator comp)
Sorts the specified range of elements according to the order induced by the specified comparator using mergesort. |
static void |
mergeSort(char[] a,
int from,
int to,
CharComparator comp,
char[] supp)
Sorts the specified range of elements according to the order induced by the specified comparator using mergesort, using a given support array. |
static void |
quickSort(char[] x)
Sorts an array according to the natural ascending order using quicksort. |
static void |
quickSort(char[] x,
CharComparator comp)
Sorts an array according to the order induced by the specified comparator using quicksort. |
static void |
quickSort(char[] x,
int from,
int to)
Sorts the specified range of elements according to the natural ascending order using quicksort. |
static void |
quickSort(char[] x,
int from,
int to,
CharComparator comp)
Sorts the specified range of elements according to the order induced by the specified comparator using quicksort. |
static void |
radixSort(char[] a)
Sorts the specified array using radix sort. |
static void |
radixSort(char[][] a)
Sorts the specified array of arrays lexicographically using radix sort. |
static void |
radixSort(char[][] a,
int from,
int to)
Sorts the specified array of arrays lexicographically using radix sort. |
static void |
radixSort(char[] a,
char[] b)
Sorts the specified pair of arrays lexicographically using radix sort. |
static void |
radixSort(char[] a,
char[] b,
int from,
int to)
Sorts the specified pair of arrays lexicographically using radix sort. |
static void |
radixSort(char[] a,
int from,
int to)
Sorts the specified array using radix sort. |
static void |
radixSortIndirect(int[] perm,
char[] a,
boolean stable)
Sorts the specified array using indirect radix sort. |
static void |
radixSortIndirect(int[] perm,
char[] a,
char[] b,
boolean stable)
Sorts the specified pair of arrays lexicographically using indirect radix sort. |
static void |
radixSortIndirect(int[] perm,
char[] a,
char[] b,
int from,
int to,
boolean stable)
Sorts the specified pair of arrays lexicographically using indirect radix sort. |
static void |
radixSortIndirect(int[] perm,
char[] a,
int from,
int to,
boolean stable)
Sorts the specified array using indirect radix sort. |
static char[] |
reverse(char[] a)
Reverses the order of the elements in the specified array. |
static char[] |
setLength(char[] array,
int length)
Sets the length of the given array. |
static char[] |
shuffle(char[] a,
int from,
int to,
Random random)
Shuffles the specified array fragment using the specified pseudorandom number generator. |
static char[] |
shuffle(char[] a,
Random random)
Shuffles the specified array using the specified pseudorandom number generator. |
static char[] |
trim(char[] array,
int length)
Trims the given array to the given length. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long ONEOVERPHI
public static final char[] EMPTY_ARRAY
public static final Hash.Strategy HASH_STRATEGY
This hash strategy may be used in custom hash collections whenever keys are
arrays, and they must be considered equal by content. This strategy
will handle null
correctly, and it is serializable.
Method Detail |
---|
public static char[] ensureCapacity(char[] array, int length)
If you cannot foresee whether this array will need again to be
enlarged, you should probably use grow()
instead.
array
- an array.length
- the new minimum length for this array.
array
, if it contains length
entries or more; otherwise,
an array with length
entries whose first array.length
entries are the same as those of array
.public static char[] ensureCapacity(char[] array, int length, int preserve)
array
- an array.length
- the new minimum length for this array.preserve
- the number of elements of the array that must be preserved in case a new allocation is necessary.
array
, if it can contain length
entries or more; otherwise,
an array with length
entries whose first preserve
entries are the same as those of array
.public static char[] grow(char[] array, int length)
Dividing by the golden ratio (φ) approximately increases the array
length by 1.618. If you want complete control on the array growth, you
should probably use ensureCapacity()
instead.
array
- an array.length
- the new minimum length for this array.
array
, if it can contain length
entries; otherwise, an array with
max(length
,array.length
/φ) entries whose first
array.length
entries are the same as those of array
.public static char[] grow(char[] array, int length, int preserve)
Dividing by the golden ratio (φ) approximately increases the array
length by 1.618. If you want complete control on the array growth, you
should probably use ensureCapacity()
instead.
array
- an array.length
- the new minimum length for this array.preserve
- the number of elements of the array that must be preserved in case a new allocation is necessary.
array
, if it can contain length
entries; otherwise, an array with
max(length
,array.length
/φ) entries whose first
preserve
entries are the same as those of array
.public static char[] trim(char[] array, int length)
array
- an array.length
- the new maximum length for the array.
array
, if it contains length
entries or less; otherwise, an array with
length
entries whose entries are the same as
the first length
entries of array
.public static char[] setLength(char[] array, int length)
array
- an array.length
- the new length for the array.
array
, if it contains exactly length
entries; otherwise, if it contains more than
length
entries, an array with length
entries
whose entries are the same as the first length
entries of
array
; otherwise, an array with length
entries
whose first array.length
entries are the same as those of
array
.public static char[] copy(char[] array, int offset, int length)
array
- an array.offset
- the first element to copy.length
- the number of elements to copy.
length
elements of array
starting at offset
.public static char[] copy(char[] array)
array
- an array.
array
.public static void fill(char[] array, char value)
This method uses a backward loop. It is significantly faster than the corresponding
method in Arrays
.
array
- an array.value
- the new value for all elements of the array.public static void fill(char[] array, int from, int to, char value)
If possible (i.e., from
is 0) this method uses a
backward loop. In this case, it is significantly faster than the
corresponding method in Arrays
.
array
- an array.from
- the starting index of the portion to fill (inclusive).to
- the end index of the portion to fill (exclusive).value
- the new value for all elements of the specified portion of the array.public static boolean equals(char[] a1, char[] a2)
This method uses a backward loop. It is significantly faster than the corresponding
method in Arrays
.
a1
- an array.a2
- another array.
public static void ensureFromTo(char[] a, int from, int to)
This method may be used whenever an array range check is needed.
a
- an array.from
- a start index (inclusive).to
- an end index (exclusive).
IllegalArgumentException
- if from
is greater than to
.
ArrayIndexOutOfBoundsException
- if from
or to
are greater than the array length or negative.public static void ensureOffsetLength(char[] a, int offset, int length)
This method may be used whenever an array range check is needed.
a
- an array.offset
- a start index.length
- a length (the number of elements in the range).
IllegalArgumentException
- if length
is negative.
ArrayIndexOutOfBoundsException
- if offset
is negative or offset
+length
is greater than the array length.public static void quickSort(char[] x, int from, int to, CharComparator comp)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.comp
- the comparator to determine the sorting order.public static void quickSort(char[] x, CharComparator comp)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the array to be sorted.comp
- the comparator to determine the sorting order.public static void quickSort(char[] x, int from, int to)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static void quickSort(char[] x)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the array to be sorted.public static void mergeSort(char[] a, int from, int to, char[] supp)
This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort. Moreover, no support arrays will be allocated.
a
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.supp
- a support array, at least as large as a
.public static void mergeSort(char[] a, int from, int to)
This sort is guaranteed to be stable: equal elements will not be reordered as a result
of the sort. An array as large as a
will be allocated by this method.
a
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static void mergeSort(char[] a)
This sort is guaranteed to be stable: equal elements will not be reordered as a result
of the sort. An array as large as a
will be allocated by this method.
a
- the array to be sorted.public static void mergeSort(char[] a, int from, int to, CharComparator comp, char[] supp)
This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort. Moreover, no support arrays will be allocated.
a
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.comp
- the comparator to determine the sorting order.supp
- a support array, at least as large as a
.public static void mergeSort(char[] a, int from, int to, CharComparator comp)
This sort is guaranteed to be stable: equal elements will not be reordered as a result
of the sort. An array as large as a
will be allocated by this method.
a
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.comp
- the comparator to determine the sorting order.public static void mergeSort(char[] a, CharComparator comp)
This sort is guaranteed to be stable: equal elements will not be reordered as a result
of the sort. An array as large as a
will be allocated by this method.
a
- the array to be sorted.comp
- the comparator to determine the sorting order.public static int binarySearch(char[] a, int from, int to, char key)
a
- the array to be searched.from
- the index of the first element (inclusive) to be searched.to
- the index of the last element (exclusive) to be searched.key
- the value to be searched for.
Arrays
public static int binarySearch(char[] a, char key)
a
- the array to be searched.key
- the value to be searched for.
Arrays
public static int binarySearch(char[] a, int from, int to, char key, CharComparator c)
a
- the array to be searched.from
- the index of the first element (inclusive) to be searched.to
- the index of the last element (exclusive) to be searched.key
- the value to be searched for.c
- a comparator.
Arrays
public static int binarySearch(char[] a, char key, CharComparator c)
a
- the array to be searched.key
- the value to be searched for.c
- a comparator.
Arrays
public static void radixSort(char[] a)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the array to be sorted.
a
- the array to be sorted.public static void radixSort(char[] a, int from, int to)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the array to be sorted.
a
- the array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static void radixSortIndirect(int[] perm, char[] a, boolean stable)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implement an indirect sort. The elements of perm
(which must
be exactly the numbers in the interval [0..perm.length)
) will be permuted so that
a[ perm[ i ] ] <= a[ perm[ i + 1 ] ]
.
This implementation is significantly faster than quicksort (unstable) or mergesort (stable)
already at small sizes (say, more than 10000 elements), but it can only
sort in ascending order.
It will allocate a support array of bytes with the same number of elements as the array to be sorted,
and, in the stable case, a further support array as large as perm
(note that the stable
version is slightly faster).
perm
- a permutation array indexing a
.a
- the array to be sorted.stable
- whether the sorting algorithm should be stable.public static void radixSortIndirect(int[] perm, char[] a, int from, int to, boolean stable)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implement an indirect sort. The elements of perm
(which must
be exactly the numbers in the interval [0..perm.length)
) will be permuted so that
a[ perm[ i ] ] <= a[ perm[ i + 1 ] ]
.
This implementation is significantly faster than quicksort (unstable) or mergesort (stable)
already at small sizes (say, more than 10000 elements), but it can only
sort in ascending order.
It will allocate a support array of bytes with the same number of elements as the array to be sorted,
and, in the stable case, a further support array as large as perm
(note that the stable
version is slightly faster).
perm
- a permutation array indexing a
.a
- the array to be sorted.from
- the index of the first element of perm
(inclusive) to be permuted.to
- the index of the last element of perm
(exclusive) to be permuted.stable
- whether the sorting algorithm should be stable.public static void radixSort(char[] a, char[] b)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implements a lexicographical sorting of the arguments. Pairs of elements
in the same position in the two provided arrays will be considered a single key, and permuted
accordingly. In the end, either a[ i ] < a[ i + 1 ]
or a[ i ] == a[ i + 1 ]
and b[ i ] <= b[ i + 1 ]
.
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the arrays to be sorted.
a
- the first array to be sorted.b
- the second array to be sorted.public static void radixSort(char[] a, char[] b, int from, int to)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implements a lexicographical sorting of the arguments. Pairs of elements
in the same position in the two provided arrays will be considered a single key, and permuted
accordingly. In the end, either a[ i ] < a[ i + 1 ]
or a[ i ] == a[ i + 1 ]
and b[ i ] <= b[ i + 1 ]
.
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the arrays to be sorted.
a
- the first array to be sorted.b
- the second array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static void radixSortIndirect(int[] perm, char[] a, char[] b, boolean stable)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implement an indirect sort. The elements of perm
(which must
be exactly the numbers in the interval [0..perm.length)
) will be permuted so that
a[ perm[ i ] ] <= a[ perm[ i + 1 ] ]
.
This implementation is significantly faster than quicksort (unstable) or mergesort (stable)
already at small sizes (say, more than 10000 elements), but it can only
sort in ascending order.
It will allocate a support array of bytes with the same number of elements as the array to be sorted,
and, in the stable case, a further support array as large as perm
(note that the stable
version is slightly faster).
perm
- a permutation array indexing a
.a
- the array to be sorted.b
- the second array to be sorted.stable
- whether the sorting algorithm should be stable.public static void radixSortIndirect(int[] perm, char[] a, char[] b, int from, int to, boolean stable)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implement an indirect sort. The elements of perm
(which must
be exactly the numbers in the interval [0..perm.length)
) will be permuted so that
a[ perm[ i ] ] <= a[ perm[ i + 1 ] ]
.
This implementation is significantly faster than quicksort (unstable) or mergesort (stable)
already at small sizes (say, more than 10000 elements), but it can only
sort in ascending order.
It will allocate a support array of bytes with the same number of elements as the array to be sorted,
and, in the stable case, a further support array as large as perm
(note that the stable
version is slightly faster).
perm
- a permutation array indexing a
.a
- the array to be sorted.b
- the second array to be sorted.from
- the index of the first element of perm
(inclusive) to be permuted.to
- the index of the last element of perm
(exclusive) to be permuted.stable
- whether the sorting algorithm should be stable.public static void radixSort(char[][] a)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implements a lexicographical sorting of the provided arrays. Tuples of elements in the same position will be considered a single key, and permuted accordingly.
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the arrays to be sorted.
a
- an array containing arrays of equal length to be sorted lexicographically in parallel.public static void radixSort(char[][] a, int from, int to)
The sorting algorithm is a tuned radix sort adapted from Peter M. McIlroy, Keith Bostic and M. Douglas McIlroy, “Engineering radix sort”, Computing Systems, 6(1), pages 5−27 (1993), and further improved using the digit-oracle idea described by Juha Kärkkäinen and Tommi Rantala in “Engineering radix sort for strings”, String Processing and Information Retrieval, 15th International Symposium, volume 5280 of Lecture Notes in Computer Science, pages 3−14, Springer (2008).
This method implements a lexicographical sorting of the provided arrays. Tuples of elements in the same position will be considered a single key, and permuted accordingly.
This implementation is significantly faster than quicksort already at small sizes (say, more than 10000 elements), but it can only sort in ascending order. It will allocate a support array of bytes with the same number of elements as the arrays to be sorted.
a
- an array containing arrays of equal length to be sorted lexicographically in parallel.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static char[] shuffle(char[] a, int from, int to, Random random)
a
- the array to be shuffled.from
- the index of the first element (inclusive) to be shuffled.to
- the index of the last element (exclusive) to be shuffled.random
- a pseudorandom number generator (please use a XorShift* generator).
a
.public static char[] shuffle(char[] a, Random random)
a
- the array to be shuffled.random
- a pseudorandom number generator (please use a XorShift* generator).
a
.public static char[] reverse(char[] a)
a
- the array to be reversed.
a
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |