你绝对想不到,世界上最奇葩的排序算法!
void sleep_sort(uint arr[], uint n){
for(uint i=0;i<n;i++){
Thread t = new Thread(){
@Override
public void run(){
sleep(arr[i]);
print(arr[i]);
}
};
t.start();
}
}
赞 (0)
void sleep_sort(uint arr[], uint n){
for(uint i=0;i<n;i++){
Thread t = new Thread(){
@Override
public void run(){
sleep(arr[i]);
print(arr[i]);
}
};
t.start();
}
}