package algorithm;
/**
* 桶排序
* @author ansj
*
*/
public class BucketSort {
/**
* 这个排序算法很恶心.但是容易写我凑个数呵呵
* @param args
*/
public static void main(String[] args) {
int [] bucket = new int[1000] ;
int[] array = {1,32,234,34,5,54,6,65,932,7,56,455} ;
for (int i : array) {
bucket[i] = 1 ;
}
for (int i = 0; i < bucket.length; i++) {
if(bucket[i]==1){
System.out.println(i);
}
}
}
}
算法实现系列第六章.桶排序
最新推荐文章于 2024-06-03 19:59:37 发布