java.lang.Object
com.aoapps.hodgepodge.sort.IntegerRadixSortExperimental
- All Implemented Interfaces:
IntegerSortAlgorithm
,SortAlgorithm<Number>
A radix sort implementation for numeric data, sorting by its integer representation.
TODO: Consider thread-local for the small sort space
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionprotected static int
get
(int[] array, int i, SortStatistics stats) protected static int
get
(IntList list, int i, SortStatistics stats) protected static <T> T
get
(List<T> list, int i, SortStatistics stats) protected static <T> T
get
(T[] array, int i, SortStatistics stats) static IntegerRadixSortExperimental
boolean
isStable()
Checks if this is a stable sort.protected static void
set
(int[] array, int i, int value, SortStatistics stats) protected static void
set
(IntList list, int i, int value, SortStatistics stats) protected static <T> void
set
(List<T> list, int i, T o, SortStatistics stats) protected static <T> void
set
(T[] array, int i, T o, SortStatistics stats) void
sort
(int[] array) static void
void
sort
(int[] array, SortStatistics stats) void
void
sort
(IntList list, SortStatistics stats) <N extends Number>
voidsort
(List<N> list, SortStatistics stats) <T extends E>
void<N extends Number>
voidsort
(N[] array, SortStatistics stats) <T extends E>
voidsort
(T[] array) protected static void
swap
(int[] array, int i, int j, SortStatistics stats) protected static void
swap
(IntList list, int i, int j, SortStatistics stats) protected static <T> void
swap
(List<T> list, int i, int j, SortStatistics stats) protected static <T> void
swap
(T[] array, int i, int j, SortStatistics stats) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoapps.hodgepodge.sort.SortAlgorithm
sort, sort
-
Method Details
-
getInstance
-
isStable
public boolean isStable()Description copied from interface:SortAlgorithm
Checks if this is a stable sort. A stable sort will keep elements with equal values in their same relative order. -
sort
- Specified by:
sort
in interfaceSortAlgorithm<Number>
-
sort
- Specified by:
sort
in interfaceSortAlgorithm<Number>
-
sort
- Specified by:
sort
in interfaceIntegerSortAlgorithm
-
sort
- Specified by:
sort
in interfaceIntegerSortAlgorithm
-
sort
-
sort
- Specified by:
sort
in interfaceIntegerSortAlgorithm
-
sort
public void sort(int[] array) - Specified by:
sort
in interfaceIntegerSortAlgorithm
-
get
-
get
-
set
-
set
-
swap
-
swap
-
sort
- Specified by:
sort
in interfaceSortAlgorithm<E>
-
sort
public <T extends E> void sort(T[] array) - Specified by:
sort
in interfaceSortAlgorithm<E>
-
get
-
get
-
set
-
set
-
swap
-
swap
-