|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.core.algo.sorts.ArrayMergeSort
| Constructor Summary | |
ArrayMergeSort()
|
|
| Method Summary | |
void |
sort(Sequence S,
Comparator c)
Performs a merge-sort, assuming the Sequence is vector-based. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ArrayMergeSort()
| Method Detail |
public void sort(Sequence S,
Comparator c)
The design of mergesort is somewhat more complex than that of the
other sorts: first, there's the main function,
mergeSort(.); this is a convenience function that just
calls mergeSortHelper(.) with default parameters (a
common tactic in recursive algorithms).
mergeSortHelper(.) recursively calls itself twice,
sorting the first and second halves of the sequence. The two
sub-arrays are then merged, yielding a sorted sequence.
S - c -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||