-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort.h
More file actions
31 lines (27 loc) · 825 Bytes
/
sort.h
File metadata and controls
31 lines (27 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _SORT_H
#define _SORT_H
#include <stdio.h>
#include <stdlib.h>
/**
* struct listint_s - Doubly linked list node
*
* @n: Integer stored in the node
* @prev: Pointer to the previous element of the list
* @next: Pointer to the next element of the list
*/
typedef struct listint_s
{
const int n;
struct listint_s *prev;
struct listint_s *next;
} listint_t;
void print_array(const int *array, size_t size);
void print_list(const listint_t *list);
void bubble_sort(int *array, size_t size);
void insertion_sort_list(listint_t **list);
void swap(listint_t *current, listint_t **head);
void selection_sort(int *array, size_t size);
void quick(int *array, int start, int end, size_t size);
int partition(int *array, int start, int end, size_t size);
void quick_sort(int *array, size_t size);
#endif /* _SORT_H */