-
Notifications
You must be signed in to change notification settings - Fork 2
/
qsort.h
39 lines (33 loc) · 991 Bytes
/
qsort.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
#ifndef QSORT_H
#define QSORT_H
#include "sort.h"
/* Implementation of qsort
1st variant uses merge-like algorithm to divide an array into the subsets: allocates memory for each subset and then merges back
2nd variant uses the same array to process the subset
_parallel versions attempt to process subsets simultaneously
*/
void quick_sort1(void *array,
unsigned int count,
unsigned int size,
assign_t assign,
swap_t swp,
compare_t cmp);
void quick_sort1_parallel(void *array,
unsigned int count,
unsigned int threads,
unsigned int size,
assign_t assign,
swap_t swp,
compare_t cmp);
void quick_sort2(void *array,
unsigned int count,
unsigned int size,
swap_t swp,
compare_t cmp);
void quick_sort2_parallel(void *array,
unsigned int count,
unsigned int threads,
unsigned int size,
swap_t swp,
compare_t cmp);
#endif