forked from mihai-negru/c-language-data-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscl_sort_algo.h
46 lines (41 loc) · 2.05 KB
/
scl_sort_algo.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @file scl_sort_algo.h
* @author Mihai Negru (determinant289@gmail.com)
* @version 1.0.0
* @date 2022-06-21
*
* @copyright Copyright (C) 2022-2023 Mihai Negru <determinant289@gmail.com>
* This file is part of C-language-Data-Structures.
*
* C-language-Data-Structures is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* C-language-Data-Structures is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with C-language-Data-Structures. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef SORT_ALGORITHMS_H_
#define SORT_ALGORITHMS_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include "scl_priority_queue.h"
#include "scl_config.h"
scl_error_t quick_sort (void *arr, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
scl_error_t merge_sort (void *arr, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
scl_error_t bubble_sort (void *arr, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
scl_error_t radix_sort (uint64_t *arr, size_t number_of_elem);
scl_error_t insertion_sort (void *arr, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
scl_error_t selection_sort (void *arr, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
scl_error_t reverse_array (void *arr, size_t number_of_elem, size_t arr_elem_size);
void* binary_search (void *arr, void *data, size_t number_of_elem, size_t arr_elem_size, compare_func cmp);
#endif /* SORT_ALGORITHMS_H_ */