public final class HeapSort extends SortApp.SortAlgorithm
SortApp.SortAlgorithm + minor improvements.stopRequested| Constructor and Description |
|---|
HeapSort() |
| Modifier and Type | Method and Description |
|---|---|
void |
downheap(int[] a,
int k,
int n)
Heap sort helper.
|
static void |
main(java.lang.String[] args)
Start as application.
|
void |
sort(int[] a)
The real sorting method.
|
getMaxPossiVal, pause, pause, pause, startMe, stop, swappublic void sort(int[] a)
SortApp.SortAlgorithmSortApp.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.SortAlgorithmpublic void downheap(int[] a,
int k,
int n)
a - the array to be sorted resp. the semi-heap to be made a
heapk - the part's root index + 1n - the part's lengthpublic static void main(java.lang.String[] args)
SortApp.SortAlgorithm.startMe()