- java.lang.Object
-
- org.jgrapht.util.RadixSort
-
public class RadixSort extends java.lang.ObjectSorts 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[]countstatic intCUT_OFFDeprecated, for removal: This API element is subject to removal in a future version.usesetCutOff(int)insteadprivate static intMASKprivate static intMAX_Dprivate static intMAX_DIGITSprivate static intSIZE_RADIX
-
Constructor Summary
Constructors Modifier Constructor Description privateRadixSort()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidradixSort(int[] array, int n, int[] tempArray, int[] cnt)static voidsetCutOff(int cutOff)static voidsort(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_OFFDeprecated, 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
-
-