Skip to content

Commit 4373123

Browse files
The prototypes of all my functions are included in your my header file called sort.h
1 parent d2ac8e5 commit 4373123

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

sort.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

0 commit comments

Comments
 (0)