Functions | |
int | numBuckets (int numElements) |
The number of buckets to use given the number of elements. | |
int | hash (double *d) |
Hash function to identify bucket number from element. | |
Variables | |
static int | num |
Computed number of bins to use for BucketSort. |
int hash | ( | double * | d | ) |
Hash function to identify bucket number from element.
Customized to properly encode elements in order within the buckets.
When range of numbers is distributed within [0,1) we subdivide into buckets of size 1/num. Thus bucket = num * (*d). Note that uniform distribution will perform better than normal distribution.
d | value to be sorted is uniformly drawn from [0,1). |
int numBuckets | ( | int | numElements | ) |
The number of buckets to use given the number of elements.
numElements | number of elements in the collection to be sorted. |
int num [static] |
Computed number of bins to use for BucketSort.
Algorithm Development Kit 1.0