|
PebbleOS
|
In-place sorting of small arrays. More...
Typedefs | |
| typedef int(* | SortComparator) (const void *, const void *) |
| qsort()-style comparator: negative, 0 or positive when a < b, a == b or a > b. | |
Functions | |
| void | sort_bubble (void *array, size_t num_elem, size_t elem_size, SortComparator comp) |
| Sort an array in ascending order with a quadratic exchange sort. | |
In-place sorting of small arrays.
| typedef int(* SortComparator) (const void *, const void *) |
qsort()-style comparator: negative, 0 or positive when a < b, a == b or a > b.
| void sort_bubble | ( | void * | array, |
| size_t | num_elem, | ||
| size_t | elem_size, | ||
| SortComparator | comp | ||
| ) |
Sort an array in ascending order with a quadratic exchange sort.
Meant for small arrays; it is not stable.
| [in,out] | array | Array to sort. |
| num_elem | Number of elements. | |
| elem_size | Size of an element in bytes. | |
| comp | Comparator. |