-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmsort.h
34 lines (28 loc) · 836 Bytes
/
msort.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
#ifndef MSORT_H
#define MSORT_H
#include "sort.h"
/* Implementation of merge sort
1st variant allocates memory for each subset and then merges back
2nd variant is non-recursive and uses only one additional array to store the partially sorted array
_parallel versions attempt to process subsets simultaneously
*/
void merge_sort1(void *array,
unsigned int count,
unsigned int size,
assign_t assign,
swap_t swp,
compare_t cmp);
void merge_sort1_parallel(void *array,
unsigned int count,
unsigned int threads,
unsigned int size,
assign_t assign,
swap_t swp,
compare_t cmp);
void merge_sort2(void *array,
unsigned int count,
unsigned int size,
assign_t assign,
swap_t swp,
compare_t cmp);
#endif