(int[] sourceArray)
| 8 | public class RadixSort implements IArraySort { |
| 9 | |
| 10 | @Override |
| 11 | public int[] sort(int[] sourceArray) throws Exception { |
| 12 | // 对 arr 进行拷贝,不改变参数内容 |
| 13 | int[] arr = Arrays.copyOf(sourceArray, sourceArray.length); |
| 14 | |
| 15 | int maxDigit = getMaxDigit(arr); |
| 16 | return radixSort(arr, maxDigit); |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * 获取最高位数 |
nothing calls this directly
no test coverage detected