public final class ShakerSort extends SortApp.SortAlgorithm
SortApp.SortAlgorithm
+ minor improvements.ShakerSort
synonymously with
BidirectionalBubbleSort
which Harrison's implementation is not.
This is a bidirectional min-max search.stopRequested
Constructor and Description |
---|
ShakerSort() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Start as application.
|
void |
sort(int[] a)
The real sorting method.
|
getMaxPossiVal, pause, pause, pause, startMe, stop, swap
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()