To employ Bucket Sort you only need to (a) provide a meaningful hash () method to return an integer given an element; and (b) provide a method to compute the number of buckets to use. More...
Go to the source code of this file.
Classes | |
struct | BUCKET |
Maintain count of entries in each bucket and array of entries. More... | |
Defines | |
#define | BUCKETSIZE 16 |
Initial size of each bucket and delta to grow when full. | |
Functions | |
int | hash (void *elt) |
Determine the means by which elements are converted to bucket indices. | |
int | numBuckets (int numElements) |
The number of buckets to use given the number of elements. |
To employ Bucket Sort you only need to (a) provide a meaningful hash () method to return an integer given an element; and (b) provide a method to compute the number of buckets to use.
#define BUCKETSIZE 16 |
Initial size of each bucket and delta to grow when full.
int hash | ( | void * | elt | ) |
Determine the means by which elements are converted to bucket indices.
Customized to properly encode elements in order within the buckets.
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. |
Algorithm Development Kit 1.0