Skip to content
Snippets Groups Projects
Commit e6db5b09 authored by clm15@inf.ufpr.br's avatar clm15@inf.ufpr.br
Browse files

Jornada dos 10 mil vetores


Signed-off-by: default avatarCristopher <clm15@inf.ufpr.br>
parent a8940cb1
Branches
No related tags found
No related merge requests found
Makefile 0 → 100644
all: Quadra.exe
Quadra.exe: libbusca.a
gcc Quadra.c -I./ -L./ -lbusca -o Quadra.exe
libbusca.a: busca.o
ar -cru libbusca.a busca.o
busca.o:
gcc -c busca.c -o busca.o
......@@ -54,6 +54,41 @@ void jogar (int *vet, int *vet_ord, int N)
printf ("Nenhum valor encontrado!\n");
}
void jornada(int Tam, int max)
{
int i, *mat[10000], *mat_ord[10000], time[4]; //cada um dos 4 times conta o tempo de um dos algoritmos de ordenação
for (i = 0; i < 10000; i++)
{
vetSort(mat[i], Tam, max);
vetcpy(mat[i], mat_ord[i], Tam);
}
// inicia time[0]
for (i = 0; i < 10000; i++)
SelectSort(mat_ord[i], Tam);
// time[0] = tempoMaq - time[0]
for (i = 0; i < 10000; i++)
vetcpy(mat[i], mat_ord[i], Tam);
// inicia time [1]
for (i = 0; i < 10000; i++)
BubbleSort(mat_ord[i], Tam);
// time[1] = tempoMaq - time[1]
for (i = 0; i < 10000; i++)
vetcpy(mat[i], mat_ord[i], Tam);
// inicia time [2]
for (i = 0; i < 10000; i++)
QuickSort_rec(mat_ord[i], 1, Tam);
// time[2] = tempoMaq - time[2]
for (i = 0; i < 10000; i++)
vetcpy(mat[i], mat_ord[i], Tam);
// inicia time [3]
for (i = 0; i < 10000; i++)
QuickSort_it(mat_ord[i], Tam);
// time[3] = tempoMaq - time[3]
}
int main (void)
{
int Tam, max, *vet, *vet_ord;
......@@ -84,7 +119,10 @@ int main (void)
jogar (vet, vet_ord, Tam);
break;
case 5:
// jornada! Desenvolver!
jornada(Tam, max);
break;
}
printf ("\nNova Entrada: ");
scanf ("%d", &menu);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment