cours_progra/bac2/os/chap3/mergeSort.h

22 lines
349 B
C
Raw Normal View History

2023-11-17 16:10:39 +01:00
#pragma once
2023-12-21 23:36:03 +01:00
#include <pthread.h>
#include <inttypes.h>
2023-11-17 16:10:39 +01:00
2023-12-21 23:36:03 +01:00
#define THREADS 4
#define merge_init(array, size) {(array), 0, {1, (size)}}
typedef struct{
int start;
int final;
} SLICE;
2023-11-17 16:10:39 +01:00
2023-12-21 23:36:03 +01:00
typedef struct {
int* array;
int _depth;
SLICE slice;
} mrg_t;
2023-11-17 16:10:39 +01:00
void* merge_sort(void*);
2023-12-21 23:36:03 +01:00
void merge(int array[], uint8_t start, uint8_t middle, uint8_t final);