-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathordenacao.h
26 lines (18 loc) · 844 Bytes
/
ordenacao.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
// Implementa o algoritmo `insertion sort`
void insertion_sort(int* vetor, int tamanho);
// Implementa o algoritmo `selection sort`
void selection_sort(int* vetor, int tamanho);
// Implementa o algoritmo `bubble sort`
void bubble_sort(int* vetor, int tamanho);
// Mescla dois vetores, inserindo os elementos na ordem correta
void merge(int* destino, int* vetor_a, int tamanho_a, int* vetor_b, int tamanho_b);
// Implementa o algoritmo `merge sort`
void merge_sort(int* vetor, int tamanho);
// Transforma o vetor em um `max heap`
void heapify(int* vetor, int tamanho, int i);
// Constroi um `max heap` a partir de um vetor
void build_max_heap(int* vetor, int tamanho);
// Implementa o algoritmo `heap sort`
void heap_sort(int* vetor, int tamanho);
// Implementa o algoritmo `quick sort`
void quick_sort(int* vetor, int inicio, int fim);