Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "Grafo.h"
  4. #include "ListaST.h"
  5. #include "SCHashST.h"
  6.  
  7. int main(int argc, char** argv) {
  8.     TSCHashST T;  
  9.     long int numVertices = 0;
  10.     //long int numPares = 1;
  11.    
  12.     long int numPares;
  13.     scanf("%ld", &numPares);
  14.     SCHashST_Init(&T, numPares);
  15.    
  16.     //Leo cada par de nombres para meterlo en mi tabla hash
  17.     while (numPares--) {
  18.         char linea1[50];
  19.         char linea2[50];
  20.         getchar();
  21.         fgets(linea1, 50, stdin);
  22.         fgets(linea2, 50, stdin);
  23.        
  24.         if((SCHashST_Search(&T,linea1)) == -1){
  25.             SCHashST_Insert(&T,linea1,numVertices);
  26.             numVertices++;
  27.         }
  28.        
  29.         if((SCHashST_Search(&T,linea2)) == -1){
  30.             SCHashST_Insert(&T,linea2,numVertices);
  31.             numVertices++;
  32.         }
  33.        
  34.        
  35.                
  36.        
  37.        
  38.        
  39.        
  40.         //printf("%ld %s %s", numPares, linea1, linea2);
  41.     }
  42.    
  43.     int aux = T.table->inicio->value;
  44.     int aux2 = T.M;
  45.     int aux3 = T.N;
  46.     int aux4 = T.table->numElem;
  47.    
  48.     printf("%d\n", aux);
  49.     printf("%d\n", aux2);
  50.     printf("%d\n", aux3);
  51.     printf("%d\n", aux4);
  52.    
  53.  
  54.     return (EXIT_SUCCESS);
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement