-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsort.h
59 lines (47 loc) · 943 Bytes
/
sort.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// sort.h
// Sorting
//
// Created by 세연 on 2022/04/10.
//
#ifndef sort_h
#define sort_h
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
typedef struct arr{
int v;
}Arr;
typedef struct heap{
Arr* arr;
int heapSize;
}Heap;
typedef struct node {
int key;
struct node* left;
struct node* right;
} NODE;
typedef struct list {
int cnt;
NODE *head;
} LIST;
void initArray(Arr*);
void printArray(Arr*, int);
void ExchangeSort(Arr*);
void uMerge(Arr*, Arr*, Arr*, int, int);
void MergeSort(Arr*, int);
void partition(int, int, int*);
void QuickSort(int, int);
void siftdown(Heap *, int);
void makeHeap(int, Heap*);
int root(Heap *);
void removeKeys(int, Heap*, Arr*);
void HeapSort(int, Heap*);
LIST *initList(void);
void insertRight (LIST *, int);
int deleteLeft (LIST*);
void printList(LIST*);
void freeList (LIST*);
void RadixSort(LIST*, LIST**);
#endif /* sort_h */