Sorting/PointerBased/bucketLinkedListSortPtr.h File Reference

Define interface for accessing Bucket Sort

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.


Detailed Description

Define interface for accessing Bucket Sort

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.

Author:
George Heineman
Date:
6/15/08

Typedef Documentation

bucketLinkedListSortPtr BUCKET

Maintain count of entries in each bucket and pointer to its first entry.

bucketLinkedListSortPtr ENTRY

linked list of elements in each bucket.


Function Documentation

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.

Parameters:
numElements number of elements in the collection to be sorted.

Algorithm Development Kit 1.0