nedata
سه شنبه 17 اردیبهشت 1387, 00:14 صبح
salam,man ye code peyda kardam toye internet ama nemidonam chetori azash estefade konam ke javab bede
age lotf konin komakam konin mamnoon misham
public class BucketSortAlgorithm {
public void sort(int[] a) throws Exception {
int m=128;
int[] count = new int[m];
for (int i=0;i<m;++i) count[i]=0;
for (int j=0;j<a.length;++j) {
++count[a[j]];
}
for (int i=0,j=0;i<m;++i)
for (; count[i]>0;--count[i]) {
a[j++]=i;
}
}
}
age lotf konin komakam konin mamnoon misham
public class BucketSortAlgorithm {
public void sort(int[] a) throws Exception {
int m=128;
int[] count = new int[m];
for (int i=0;i<m;++i) count[i]=0;
for (int j=0;j<a.length;++j) {
++count[a[j]];
}
for (int i=0,j=0;i<m;++i)
for (; count[i]>0;--count[i]) {
a[j++]=i;
}
}
}