Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public final class IntegerRadixSort extends Object
http://erik.gorset.no/2011/04/radix-sort-is-faster-than-quicksort.html
with source provided at https://github.com/gorset/radix/blob/master/Radix.java
TODO: For concurrent implementation: Might get better performance (due to cache
locality of reference) by flattening the two-dimensional fixed dimensions of
the arrays into a single dimension.
TODO: For concurrent implementation: Might also consider changing the row/column
order of the multi-dimensional arrays to help cache interaction. Might get
better throughput when hit the cache wall where performance drops considerably.| Modifier and Type | Method and Description |
|---|---|
protected 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 IntegerRadixSort |
getInstance()
Gets the default IntegerRadixSort using the default executor service.
|
static IntegerRadixSort |
getInstance(ExecutorService executor)
Gets a IntegerRadixSort that uses the provided ExecutorService.
|
static IntegerRadixSort |
getSingleThreadedInstance()
Gets a single-threaded instance of IntegerRadixSort, that will not ever
sort concurrently.
|
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) |
void |
sort(int[] array,
SortStatistics stats) |
void |
sort(IntList list) |
void |
sort(IntList list,
SortStatistics stats) |
<N extends Number> |
sort(List<N> list,
SortStatistics stats) |
<T extends E> |
sort(List<T> list) |
<N extends Number> |
sort(N[] array,
SortStatistics stats) |
<T extends E> |
sort(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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsort, sortpublic static IntegerRadixSort getInstance()
public static IntegerRadixSort getSingleThreadedInstance()
getInstance for most scenarios.getInstance()public static IntegerRadixSort getInstance(ExecutorService executor)
null, concurrency is disabled.public boolean isStable()
SortAlgorithmpublic <N extends Number> void sort(List<N> list, SortStatistics stats)
sort in interface SortAlgorithm<Number>public <N extends Number> void sort(N[] array, SortStatistics stats)
sort in interface SortAlgorithm<Number>public void sort(IntList list, SortStatistics stats)
sort in interface IntegerSortAlgorithmpublic void sort(int[] array,
SortStatistics stats)
sort in interface IntegerSortAlgorithmpublic void sort(IntList list)
sort in interface IntegerSortAlgorithmpublic void sort(int[] array)
sort in interface IntegerSortAlgorithmprotected static int get(IntList list, int i, SortStatistics stats)
protected static int get(int[] array,
int i,
SortStatistics stats)
protected static void set(IntList list, int i, int value, SortStatistics stats)
protected static void set(int[] array,
int i,
int value,
SortStatistics stats)
protected static void swap(IntList list, int i, int j, SortStatistics stats)
protected static void swap(int[] array,
int i,
int j,
SortStatistics stats)
public <T extends E> void sort(List<T> list)
sort in interface SortAlgorithm<E>public <T extends E> void sort(T[] array)
sort in interface SortAlgorithm<E>protected static <T> T get(List<T> list, int i, SortStatistics stats)
protected static <T> T get(T[] array,
int i,
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)
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)
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.