loteria.h 1.48 KB
Newer Older
Ivo Júnior's avatar
Ivo Júnior committed
1 2 3 4 5 6
//#######################################################################
//## TP1 ALGORITMOS II 2015/2 - Loja de Vinis VINILERA                 ##
//## Nomes: Ivo de Souza Bueno Júnior - GRR20154004                    ##
//##        Felipe Lopes Pereira      - GRR20153190                    ##	
//#######################################################################

7 8 9 10 11 12 13 14
#ifndef _LOTERIA_H
#define _LOTERIA_H

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include"pilha.h"

Ivo Júnior's avatar
Ivo Júnior committed
15 16
//Macros
#define MAXVETOR 10000
17
#define TESTES 10000
Ivo Júnior's avatar
Ivo Júnior committed
18
#define MAXVALOR 10000
19 20
#define MAXSTR 32

Ivo Júnior's avatar
Ivo Júnior committed
21
//Declaração de variáveis locais
22
int vetorDes[MAXVETOR], vetorOrd[MAXVETOR];
23
char buffer[32];
24

Ivo Júnior's avatar
Ivo Júnior committed
25
//Algoritmos de ordenação
26 27 28
void SelectSort(int vetor[], int tam);
void BubbleSort(int vetor[], int tam);
void QuickRec(int vetor[], int esq, int dir);
29
void QuickIt(int vetor[], tipoPilha *pilha ,int esq, int dir);
30

Ivo Júnior's avatar
Ivo Júnior committed
31
//Algoritmos de pesquisa
32 33 34
int PesqSec(int vetor[], int tam, int elem);
int PesqBin(int vetor[], int elem, int esq, int dir);

Ivo Júnior's avatar
Ivo Júnior committed
35
//Outros algoritmos utilizados
36 37
void Limpa();
void ToLogFile(char string[MAXSTR]);
38 39
int Mediana(int vetor[], int esq, int meio, int dir);
void Particao(int vetor[], int esq, int dir, int *posicaoPivo);
40
void TempoExecucao(int vetor[], int tam, int numMax);
41 42 43 44 45 46
void OrdenaVetor(int vetorDes[], int vetorOrd[], int ordenacao, int tam);
void GeraVetor(int vetor[], int tam, int numMax);
void Setup(int vetorDes[], int vetorOrd[], int *tam, int *numMax);
void ImprimeVetor(int vetor[], int tam);

#endif