mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 03:59:38 +08:00
Update Sorts/BucketSort.java
This commit is contained in:
@ -50,7 +50,7 @@ public class BucketSort {
|
|||||||
|
|
||||||
/* store elements to buckets */
|
/* store elements to buckets */
|
||||||
for (int value : arr) {
|
for (int value : arr) {
|
||||||
int hash = hash(value, max, numberOfBuckets);
|
int hash = hash(value, min, numberOfBuckets);
|
||||||
buckets.get(hash).add(value);
|
buckets.get(hash).add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user