Commit | Line | Data |
---|---|---|
1 | #ifndef SORT_H | |
2 | #define SORT_H | |
3 | ||
4 | #include <stdbool.h> | |
5 | ||
6 | typedef bool(*c_criteria_cb)(int a); | |
7 | ||
8 | bool is_even(int a); | |
9 | bool is_odd(int a); | |
10 | ||
11 | typedef bool(*s_criteria_cb)(int a, int b); | |
12 | ||
13 | /* sort criteria */ | |
14 | bool ascending(int a, int b); | |
15 | bool descending(int a, int b); | |
16 | bool ascending_and_even(int a, int b); | |
17 | bool ascending_and_odd(int a, int b); | |
18 | ||
19 | void sort_bubble_array(int* array, unsigned length, s_criteria_cb sort_criteria); | |
20 | ||
21 | #endif /* SORT_H */ |