Sorting Functions

:Associate with "Sorting Functions" More...

Functions

LIBEXPORT void heapsort (void *array, INT32 n, INT32 size, int(*compare)(void *a, void *b, void *hookdata), void *hookdata)
LIBEXPORT int HeapSortGen (INT32 n, int(*compare)(INT32 a, INT32 b, void *hookdata), int(*swap)(INT32 a, INT32 b, void *hookdata), void *hookdata)

Detailed Description

:Associate with "Sorting Functions"


Function Documentation

LIBEXPORT void heapsort void *  array,
INT32  n,
INT32  size,
int(*  compare)(void *a, void *b, void *hookdata),
void *  hookdata
 

Memory based heapsort.

Sorts an array in memory. Assumes it can use memcpy() to swap items.

Parameters:
array  Array to sort
n  Number of elements in array
size  sizeof() each element
hookdata  Compare function. Return 1 if *a <= *b. Passed as 3rd parameter to compare function

LIBEXPORT int HeapSortGen INT32  n,
int(*  compare)(INT32 a, INT32 b, void *hookdata),
int(*  swap)(INT32 a, INT32 b, void *hookdata),
void *  hookdata
 

Generic Heapsort.

Parameters:
n  Number of items to sort
swap  Return 1 if item a <= item b
hookdata  Swap two items Passed as 3rd parameter to compare and swap functions


Generated on Wed May 31 15:29:23 2006 for TNTsdk by  doxygen 1.3.8-20040913