部分排序算法总结
1.简化版桶排序
public class Sort {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner sc = new Scanner(System.in);
System.out.println("请输入个数:");
int number = sc.nextInt();
int[] sort = new int[number];
for (int i = 0; i < number; i++) {
sort[i] = sc.nextInt();
}
BucketSort(sort);
}
/**
* 桶排序
* @param sort
*/
public static void BucketSort(int[] sort) {
int[] bucket = new int[100];
for (int i = 0; i < sort.length; i++) {
bucket[sort[i]]++;
}