- java.lang.Object
-
- org.jgrapht.util.RadixSort
-
public class RadixSort extends java.lang.Object
Sorts the specified list of integers into ascending order using the Radix Sort method. This algorithms runs in $O(N + V)$ time and uses $O(N + V)$ extra memory, where $V = 256$. If $N \leq RadixSort.CUT\_OFF$ then the standard Java sorting algorithm is used. The specified list must be modifiable, but need not be resizable.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
count
static int
CUT_OFF
Deprecated, for removal: This API element is subject to removal in a future version.usesetCutOff(int)
insteadprivate static int
MASK
private static int
MAX_D
private static int
MAX_DIGITS
private static int
SIZE_RADIX
-
Constructor Summary
Constructors Modifier Constructor Description private
RadixSort()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
radixSort(int[] array, int n, int[] tempArray, int[] cnt)
static void
setCutOff(int cutOff)
static void
sort(java.util.List<java.lang.Integer> list)
Sort the given list in ascending order.
-
-
-
Field Detail
-
CUT_OFF
@Deprecated(since="1.5.2", forRemoval=true) public static int CUT_OFF
Deprecated, for removal: This API element is subject to removal in a future version.usesetCutOff(int)
instead
-
MAX_DIGITS
private static final int MAX_DIGITS
- See Also:
- Constant Field Values
-
MAX_D
private static final int MAX_D
- See Also:
- Constant Field Values
-
SIZE_RADIX
private static final int SIZE_RADIX
- See Also:
- Constant Field Values
-
MASK
private static final int MASK
- See Also:
- Constant Field Values
-
count
private static int[] count
-
-
Method Detail
-
setCutOff
public static void setCutOff(int cutOff)
-
radixSort
private static void radixSort(int[] array, int n, int[] tempArray, int[] cnt)
-
sort
public static void sort(java.util.List<java.lang.Integer> list)
Sort the given list in ascending order.- Parameters:
list
- the input list of integers
-
-