libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Typedefs | |
typedef int(* | GblSortComparatorFn) (const void *, const void *) |
typedef void(* | GblSortFn) (void *, size_t, size_t, GblSortComparatorFn) |
Functions | |
void | gblSortSelection (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortQuick (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortInsertion (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortShell (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortMerge (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortComb (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortBubble (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
void | gblSortHeap (void *pArray, size_t count, size_t elemSize, GblSortComparatorFn pFnCmp) |
size_t | gblSearchBinary (void *pSrc, size_t elemSize, int l, int r, void *pDst, GblSortComparatorFn pFnCmp) |
Generialized array sorting algorithms.
This file contains a collection of sorting algorithms, each with the same function prototype so that they can be passed around generically. Each is expected to operate on an array of data, accepting a custom comparator callback.
Definition in file gimbal_sort.h.
typedef int(* GblSortComparatorFn) (const void *, const void *) |
Function taking two elements and returning their numeric difference as an integer.
Definition at line 26 of file gimbal_sort.h.
typedef void(* GblSortFn) (void *, size_t, size_t, GblSortComparatorFn) |
Generic function pointer type for containing one of the array sorting algorithms.
Definition at line 28 of file gimbal_sort.h.
size_t gblSearchBinary | ( | void * | pSrc, |
size_t | elemSize, | ||
int | l, | ||
int | r, | ||
void * | pDst, | ||
GblSortComparatorFn | pFnCmp | ||
) |
Performs a Binary Search over the given array, from index l
to index r
, returning its position.