mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
Added Semicolon to Avoid Auto Semicolon Insertion
This fixes a [recommendation on lgtm](9fe2ca0492/files/Sorts/bucketSort.js
)
This commit is contained in:
@ -42,7 +42,7 @@ function bucketSort(list, size){
|
|||||||
// bucket fill
|
// bucket fill
|
||||||
for(let iBucket = 0; iBucket < list.length; iBucket++){
|
for(let iBucket = 0; iBucket < list.length; iBucket++){
|
||||||
let key = Math.floor((list[iBucket] - min) / size);
|
let key = Math.floor((list[iBucket] - min) / size);
|
||||||
buckets[key].push(list[iBucket])
|
buckets[key].push(list[iBucket]);
|
||||||
}
|
}
|
||||||
let sorted = [];
|
let sorted = [];
|
||||||
// now sort every bucket and merge it to the sorted list
|
// now sort every bucket and merge it to the sorted list
|
||||||
@ -59,4 +59,4 @@ let arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14];
|
|||||||
console.log(arrOrignal);
|
console.log(arrOrignal);
|
||||||
arrSorted = bucketSort(arrOrignal);
|
arrSorted = bucketSort(arrOrignal);
|
||||||
//Array after sort
|
//Array after sort
|
||||||
console.log(arrSorted);
|
console.log(arrSorted);
|
||||||
|
Reference in New Issue
Block a user