classRadixSort {//基数排序,基于计数排序,按数位从低到高来排序publicstaticint[] countingSort(intarr[],intexponent) {//基数exponent按10进位,range为10intrange = 10;int[] countList =newint[range];int[] sortedList =newint[arr.length];//设定最小值以支持负数intmin = arr[0];for(inti = 0;...
import java.util.Arrays; public class RadixSort { public static void main(String[] args) { int arr[] = {53,45,6,378,15,234,78}; System.out.println("排序前"); System.out.println(Arrays.toString(arr)); radixSort(arr); System.out.println("排序后"); System.out.println(Arrays.toStrin...