Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sorts/bucketSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function bucketSort(list, size){
// bucket fill
for(let iBucket = 0; iBucket < list.length; iBucket++){
let key = Math.floor((list[iBucket] - min) / size);
buckets[key].push(list[iBucket])
buckets[key].push(list[iBucket]);
}
let sorted = [];
// now sort every bucket and merge it to the sorted list
Expand All @@ -59,4 +59,4 @@ let arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14];
console.log(arrOrignal);
arrSorted = bucketSort(arrOrignal);
//Array after sort
console.log(arrSorted);
console.log(arrSorted);