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 | entry |
| struct | b |
Typedefs | |
| typedef entry | ENTRY |
| linked list of elements in each bucket. | |
| typedef b | BUCKET |
| Maintain count of entries in each bucket and pointer to its first entry. | |
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.
This implementation stores the elements of the bucket in linked lists.
| bucketLinkedListSortPtr BUCKET |
Maintain count of entries in each bucket and pointer to its first entry.
| bucketLinkedListSortPtr ENTRY |
linked list of elements in each bucket.
| 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