Sorting/PointerBased/bucketArraySortPtr.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  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.


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.

Author:
George Heineman
Date:
6/15/08

Define Documentation

#define BUCKETSIZE   16

Initial size of each bucket and delta to grow when full.


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