AceSorting
1.0.0
Sorting algorithms for Arduino including Bubble Sort, Insertion Sort, Selection Sort, Shell Sort (3 versions), Comb Sort (4 versions), Quick Sort (3 versions)
|
Go to the source code of this file.
Macros | |
#define | ACE_SORTING_DIRECT_INSERTION_SORT 0 |
If set to 1, use the direct inlined implementation of the 2-argument insertionSort(). More... | |
Functions | |
template<typename T > | |
void | ace_sorting::insertionSort (T data[], uint16_t n) |
Insertion sort. More... | |
template<typename T , typename F > | |
void | ace_sorting::insertionSort (T data[], uint16_t n, F &&lessThan) |
Same as the 2-argument insertionSort() with the addition of a lessThan lambda expression or function. More... | |
Insertion sort. See https://en.wikipedia.org/wiki/Insertion_sort
Definition in file insertionSort.h.
#define ACE_SORTING_DIRECT_INSERTION_SORT 0 |
If set to 1, use the direct inlined implementation of the 2-argument insertionSort().
Otherwise, use the 3-argument insertionSort() to implement 2-argument insertionSort(). For insertionSort(), the compiler will optimize both versions to be identical.
Definition at line 42 of file insertionSort.h.
void ace_sorting::insertionSort | ( | T | data[], |
uint16_t | n | ||
) |
Insertion sort.
Average complexity: O(n^2) See https://en.wikipedia.org/wiki/Insertion_sort
T | type of data to sort |
Definition at line 76 of file insertionSort.h.
void ace_sorting::insertionSort | ( | T | data[], |
uint16_t | n, | ||
F && | lessThan | ||
) |
Same as the 2-argument insertionSort() with the addition of a lessThan
lambda expression or function.
T | type of data to sort |
F | type of lambda expression or function that returns true if a < b |
Definition at line 92 of file insertionSort.h.