Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "Grafo.h"
- #include "ListaST.h"
- #include "SCHashST.h"
- int main(int argc, char** argv) {
- TSCHashST T;
- long int numVertices = 0;
- //long int numPares = 1;
- long int numPares;
- scanf("%ld", &numPares);
- SCHashST_Init(&T, numPares);
- //Leo cada par de nombres para meterlo en mi tabla hash
- while (numPares--) {
- char linea1[50];
- char linea2[50];
- getchar();
- fgets(linea1, 50, stdin);
- fgets(linea2, 50, stdin);
- if((SCHashST_Search(&T,linea1)) == -1){
- SCHashST_Insert(&T,linea1,numVertices);
- numVertices++;
- }
- if((SCHashST_Search(&T,linea2)) == -1){
- SCHashST_Insert(&T,linea2,numVertices);
- numVertices++;
- }
- //printf("%ld %s %s", numPares, linea1, linea2);
- }
- int aux = T.table->inicio->value;
- int aux2 = T.M;
- int aux3 = T.N;
- int aux4 = T.table->numElem;
- printf("%d\n", aux);
- printf("%d\n", aux2);
- printf("%d\n", aux3);
- printf("%d\n", aux4);
- return (EXIT_SUCCESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement