-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSort.h
More file actions
34 lines (24 loc) · 1017 Bytes
/
Sort.h
File metadata and controls
34 lines (24 loc) · 1017 Bytes
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
/* ========================================================================= *
* Sort
* ========================================================================= */
#ifndef _SORT_H_
#define _SORT_H_
#include <stddef.h>
/* ------------------------------------------------------------------------- *
* Sort an array of integers.
*
* PARAMETERS
* array The array to sort
* length Number of elements in the array
* ------------------------------------------------------------------------- */
void sort(int* array, size_t length);
void MergeSort(int* array, size_t a, size_t b);
void Merge(int* array, size_t a, size_t mid ,size_t b);
int partition(int* array, size_t a, size_t b);
void QuickSort(int* array, size_t a, size_t b);
void Build_Max_Heap(int* A, size_t length);
void Max_Heapify(int* A, size_t i, size_t heap_size);
void HeapSort(int* A, size_t length);
void InMerge(int* array, size_t a, size_t b);
void InPlaceMerge(int* array,size_t p,size_t q,size_t r);
#endif // !_SORT_H_