算法實現系列第六章.桶排序

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);
}
}
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章