File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifndef SORT_H
2+ #define SORT_H
3+
4+ #include <stdio.h>
5+ #include <stdlib.h>
6+
7+ /*Comparison direction macros for bitonic sort*/
8+ #define UP 0
9+ #define DOWN 1
10+
11+ /*enum bool - Enumeration of boolean values*/
12+ typedef enum bool
13+ {
14+ false = 0 ,
15+ true
16+ } bool ;
17+
18+
19+ /**
20+ * struct listint_s - Doubly linked list node
21+ *
22+ * @n: Integer stored in the node
23+ * @prev: Pointer to the previous element of the list
24+ * @next: Pointer to the next element of the list
25+ */
26+ typedef struct listint_s
27+ {
28+ const int n ;
29+ struct listint_s * prev ;
30+ struct listint_s * next ;
31+ } listint_t ;
32+
33+ /*Helper for swapping*/
34+ void swap_ints (int * a , int * b );
35+
36+ /*Printing helper functions */
37+ void print_array (const int * array , size_t size );
38+ void print_list (const listint_t * list );
39+
40+ /*Regular functions prototypes*/
41+ void bubble_sort (int * array , size_t size );
42+ void insertion_sort_list (listint_t * * list );
43+ void selection_sort (int * array , size_t size );
44+ void quick_sort (int * array , size_t size );
45+
46+
47+
48+ #endif
You can’t perform that action at this time.
0 commit comments