22 lines
349 B
C
22 lines
349 B
C
#pragma once
|
|
|
|
#include <pthread.h>
|
|
#include <inttypes.h>
|
|
|
|
#define THREADS 4
|
|
#define merge_init(array, size) {(array), 0, {1, (size)}}
|
|
|
|
typedef struct{
|
|
int start;
|
|
int final;
|
|
} SLICE;
|
|
|
|
typedef struct {
|
|
int* array;
|
|
int _depth;
|
|
SLICE slice;
|
|
} mrg_t;
|
|
|
|
void* merge_sort(void*);
|
|
void merge(int array[], uint8_t start, uint8_t middle, uint8_t final);
|