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) |
| LIBEXPORT void heapsort | ( | void * | array, | |
| INT32 | n, | |||
| INT32 | size, | |||
| int(*)(void *a, void *b, void *hookdata) | compare, | |||
| void * | hookdata | |||
| ) |
Memory based heapsort.
Sorts an array in memory. Assumes it can use memcpy() to swap items.
| 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(*)(INT32 a, INT32 b, void *hookdata) | compare, | |||
| int(*)(INT32 a, INT32 b, void *hookdata) | swap, | |||
| void * | hookdata | |||
| ) |
Generic Heapsort.
| 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 |
1.6.1