public abstract class MergeSort<T extends java.lang.Comparable> extends java.lang.Object implements SortingEngine<T>
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 |
---|
MergeSort() |
Modifier and Type | Method and Description |
---|---|
void |
merge(T[] source,
int s,
int m,
int e,
T[] target)
Objective: MERGE and SORT 2 parts (s to m and m to e) of an array A (read-only), into an
output array B.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sort, sortList
checkArray, checkIntArray, checkList
public void merge(T[] source, int s, int m, int e, T[] target)
source
- unsorted input arrays
- start indexm
- midpointe
- end indextarget
- auxiliary array to help in the sort process