-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplateT1.c
67 lines (48 loc) · 1.19 KB
/
templateT1.c
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
60
61
62
/**
* @file nome_do_arquivo.c
* @author Nome_do_Aluno
* @version 0.3
* @date 2023-08-28
*
* @copyright Copyright (c) 2023
*
*
* Atenção: Antes de entregar, conferir se dos dados acima da documentação estão
* preenchidos corretamente.
*
*/
#include <stdio.h>
void copia(int *A, int *v, int size);
void bubbleSort(int *A, int size);
// void selectionSort(int *A, int size);
// void insertionSort(int *A, int size);
// void quickSort(int *A, int size);
int main(){
int i;
int vetor[] = {1, 20, -10, 30, 5, 7};
int tamanhoVetor = (int)sizeof(vetor)/sizeof(int);
printf("\nVetor original: ");
for (i = 0 ; i < tamanhoVetor ; i++)
printf("%d ", vetor[i]);
printf("\nVetor tamanho = %d\n", tamanhoVetor);
// bubble sort
int bubbleVec[tamanhoVetor];
copia(vetor, bubbleVec, tamanhoVetor);
bubbleSort(bubbleVec, tamanhoVetor);
printf("\nBubble sort: ");
for (i = 0 ; i < tamanhoVetor ; i++)
printf("%d ", bubbleVec[i]);
printf("\n");
// selection sort
// insertion sort
// quick sort
return 0;
}
void copia(int *A, int *V, int size){
int i;
for (i = 0 ; i < size ; i++)
V[i] = A[i];
}
void bubbleSort(int *A, int size){
// implementação do Bubble
}