public abstract class BucketSort<T extends java.lang.Comparable> extends java.lang.Object implements SortingEngine<T>
A sort algorithm (non-stable, out-of-place) that uses O(n) space and provides O(n) best-case and O(n^2) average/worst-case time-complexity.
ARRAY_IS_EMPTY, DATA_TYPE_NOT_SUPPORTED_YET, DECIMAL_RADIX, DELIMITER_COMMA, ELEMENT_NOT_FOUND, LIST_IS_EMPTY, OPERATION_NOT_SUPPORTED_YET
Constructor and Description |
---|
BucketSort() |
Modifier and Type | Method and Description |
---|---|
abstract int |
bucketIndex(T obj,
int n) |
void |
sort(T[] objects) |
ListNode<T> |
sortList(ListNode<T> head) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkArray, checkIntArray, checkList
public void sort(T[] objects)
sort
in interface SortingEngine<T extends java.lang.Comparable>
public abstract int bucketIndex(T obj, int n)