基数排序 package basic.sort; import java.util.Arrays; import java.util.Random; public class RadixSort { /** * use LSD * @param number * @param d key code number in fact is the radix; */ private void radixSort(int[] number, int d) { int k = 0; int n = 1;…
2.3 归并排序 接口定义: int merge(void* data, int esize, int lpos, int dpos, int rpos, int (*compare)(const void* key1, const void* key2)); 返回值:成功 0:失败 -1. int merge_sort(void* data, int size, int esize, int lpos, int rpos, int (*compare)(const void* key1, co…
基数排序是基于桶排序实现的,总之基本思想是:先基于个位进行桶排序,更新原序列:再基于十位进行桶排序,更新原序列-- code1:java import java.util.*; public class JavaTest1 { public static void main(String[] args) { int a[]={1,255,8,6,25,47,14,35,58,75,96,158,657}; bucketsort(a); showset(a); } public static vo…