Commit | Line | Data |
---|---|---|
fac749d5 JB |
1 | #ifndef SORT_H |
2 | #define SORT_H | |
3 | ||
33b9c646 JB |
4 | #include <stdbool.h> |
5 | ||
210f7f05 | 6 | typedef bool(*s_criteria_cb)(int a, int b); |
33b9c646 JB |
7 | |
8 | /* sort criteria */ | |
9 | bool ascending(int a, int b); | |
10 | bool descending(int a, int b); | |
e4001676 JB |
11 | bool ascending_and_even(int a, int b); |
12 | bool ascending_and_odd(int a, int b); | |
33b9c646 | 13 | |
210f7f05 | 14 | void sort_bubble_array(int* array, unsigned length, s_criteria_cb sort_criteria); |
fac749d5 JB |
15 | |
16 | #endif /* SORT_H */ |