public final class RadixSort extends SortApp.SortAlgorithm
SortApp.SortAlgorithm
+ minor improvements.stopRequested
Constructor and Description |
---|
RadixSort() |
Modifier and Type | Method and Description |
---|---|
static int |
getRadix(int number,
int radixPos)
Get the digit value for radix respectively base 8.
|
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 numDigits)
Internal sort helper.
|
getMaxPossiVal, pause, pause, pause, startMe, stop, swap
void sort(int[] a, int numDigits)
a
- the array to be sortednumDigits
- the number of digits in the largest numberpublic 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 int getRadix(int number, int radixPos)
number
- the numberradixPos
- the radix position (0 = least significant digit)public static void main(java.lang.String[] args)
SortApp.SortAlgorithm.startMe()