
function buckertSort(array){
    var max = Math.max.apply(0, array);
    var m = getLoopTimes(max), n = array.length;
    for(var i = 1; i <= m; i++){
        buckertSortImpl(array, n, i);
    }
}
function buckertSortImpl(array, len, d){
    var buckets = [];
    for(var i = 0; i < 10; i++){
        buckets[i] = []; //初始化10个桶
    }
    for(var i = 0; i < len; i++){
        //如798个位桶index=(798/Math.pow(10, 1))%10=8
        //十位桶index=(798/Math.pow(10, 1))%10=9
        //百位桶index=(798/Math.pow(10, 1))%10=7
    }
}

//获取数字的位数
function getLoopTimes(num){
    var count = 1;
    var temp = num / 10;
    while(temp != 0) {
        count++;
        temp = temp / 10;
    }
    return count;
}