forked from kennedyufersa/hashTable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (47 loc) · 1.25 KB
/
Copy pathmain.cpp
File metadata and controls
61 lines (47 loc) · 1.25 KB
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
#include "Hash.cpp"
#include "lerArquivos.cpp"
int inserirTodos(hash H, dataItem *d, int (*funcHash)(dataItem *)) {
for (int i = 0; i < SIZE; i++) {
inserir(H, d+i, funcHash);
}
return -1;
}
int removerTodos(hash H, dataItem *d, int (*funcHash)(dataItem *)) {
for (int i = 0; i < SIZE; i++) {
remover(H, d[i].key, funcHash);
}
return -1;
}
int main() {
char *arquivo1 = (char *)"bancoDeDados/legenda.txt";
cidade *cities = getCidades(arquivo1);
char *arquivo2 = (char *)"bancoDeDados/coordenadas.csv";
gps *locais = getGps(arquivo2);
dataItem *d = getItens(cities, locais);
hash H;
init(H);
inserirTodos(H, d, divisao);
printHash(H);
//system("pause");
//system("cls");
int key = buscar(H, 110006, divisao);
if (key == -1) {
printf("\nItem não encontrado na Busca\n");
}
else {
printf("\n\n Item Buscado:\n\n");
printItem(H, key);
printf("\n\n");
remover(H, 110006, divisao);
printf("\n\n");
}
//system("pause");
//system("cls");
printHash(H);
//system("pause");
//system("cls");
//removerTodos(H, d, divisao);
saveData(H);
printf("\nFim da Execução!\n");
return 0;
}