#include <stdlib.h>
#include "report.h"
#include "bucketArraySortPtr.h"
Functions | |
static void | insert (BUCKET *bucket, void *elt) |
Insert into bucket and extend as needed by doubling the size of the bucket array storage. | |
static void | insertionSortPointers (void **ar, int n, int(*cmp)(const void *, const void *)) |
Use Insertion Sort to sort the pointers in the bucket array. | |
void | extract (BUCKET buckets[], int(*cmp)(const void *, const void *), void **ar) |
One by one remove and overwrite ar with proper values. | |
void | sortPointers (void **ar, int n, int(*cmp)(const void *, const void *)) |
Invoke BucketSort on the given array. | |
Variables | |
static BUCKET * | buckets = 0 |
Allocation of buckets and the number of buckets allocated. | |
static int | num = 0 |
Number of buckets. |
void extract | ( | BUCKET | buckets[], | |
int(*)(const void *, const void *) | cmp, | |||
void ** | ar | |||
) |
One by one remove and overwrite ar with proper values.
static void insert | ( | BUCKET * | bucket, | |
void * | elt | |||
) | [static] |
Insert into bucket and extend as needed by doubling the size of the bucket array storage.
static void insertionSortPointers | ( | void ** | ar, | |
int | n, | |||
int(*)(const void *, const void *) | cmp | |||
) | [static] |
Use Insertion Sort to sort the pointers in the bucket array.
void sortPointers | ( | void ** | ar, | |
int | n, | |||
int(*)(const void *, const void *) | cmp | |||
) |
Invoke BucketSort on the given array.
int num = 0 [static] |
Number of buckets.
Algorithm Development Kit 1.0