public final class ExtraStorageMergeSort extends SortApp.SortAlgorithm
SortApp.SortAlgorithm
+ minor improvements.stopRequested
Constructor and Description |
---|
ExtraStorageMergeSort() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Start as application.
|
void |
sort(int[] a)
The real sorting method.
|
(package private) void |
sort(int[] a,
int lo,
int hi,
int[] scratch)
Merge sort with extra buffer.
|
getMaxPossiVal, pause, pause, pause, startMe, stop, swap
void sort(int[] a, int lo, int hi, int[] scratch)
a
- the array to be sortedlo
- the lower index of the range to be sortedhi
- the upper index +1 of the range to be sortedscratch
- a buffer to be used freely (at lest as long as a)public void sort(int[] a)
SortApp.SortAlgorithm
SortApp.SortAlgorithm.pause(int, int)
, SortApp.SortAlgorithm.pause(int)
, SortApp.SortAlgorithm.pause()
directly
or indirectly by utilising SortApp.SortAlgorithm.swap(int, int)
for element
exchanges within the array having been provided to this
sort
implementation. pausing
does all else like counting steps,
displaying the sorting state and else.sort
in class SortApp.SortAlgorithm
public static void main(java.lang.String[] args)
SortApp.SortAlgorithm.startMe()