public final class IntUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int[] |
clone(int[] array)
Return a clone of the given int array.
|
static boolean |
equals(int[] left,
int[] right)
Compare two int arrays.
|
static void |
fill(int[] array,
int value)
Fill the given int array with the given value.
|
static void |
quicksort(int[] source)
Sorts this array of integers according to the Quicksort algorithm.
|
static void |
quicksort(int[] source,
int left,
int right)
Sort a subarray of a source array.
|
static int[] |
subArray(int[] input,
int start,
int end)
Generates a subarray of a given int array.
|
static java.lang.String |
toHexString(int[] input) |
static java.lang.String |
toString(int[] input) |
public static boolean equals(int[] left, int[] right)
left
- the first int arrayright
- the second int arraypublic static int[] clone(int[] array)
array
- the array to clonepublic static void fill(int[] array, int value)
array
- the arrayvalue
- the valuepublic static void quicksort(int[] source)
This implementation is based on the quicksort algorithm as described in
Data Structures In Java
by Thomas A. Standish, Chapter 10,
ISBN 0-201-30564-X.
source
- the array of integers that needs to be sorted.public static void quicksort(int[] source, int left, int right)
source
- the int array to be sortedleft
- the start index of the subarrayright
- the end index of the subarraypublic static int[] subArray(int[] input, int start, int end)
input
- -
the input int arraystart
- -
the start indexend
- -
the end indexpublic static java.lang.String toString(int[] input)
input
- an int arraypublic static java.lang.String toHexString(int[] input)
input
- an int arary