#include #include #include /*Size of the hashtable*/ #define TABLE_SIZE 250000 #define MAXSIZE 30 //Declaration de liste chainee de chaines de caracteres typedef struct cell { char val[MAXSIZE]; struct cell * suiv; } Cellule, *Ptcellule, *Liste; typedef struct salle{ char* region; int affiliate_id; char* affiliate_name; }Salle; typedef struct athlete{ int id_athlete; char* lastname; char* firstname; char gender; int age; char* weight; char* height; int overallscore; int overallrank; int score; char* scoredisplay; int rank; Salle* salle; }Athlete; typedef Athlete* AllAthletes; //déclaration de la table hashage typedef Liste Hashtable[TABLE_SIZE]; //initialisation de la table de hachage void init_ht(Hashtable ht) { for(int i=0;ival) < 0) ) { // empty list or mo\ t < head => new head ajout_tete(pl,mot); } else { if (strcmp(mot, (*pl)->val) > 0) // mot > head => add in next's { ajout_alphab(&(*pl)->suiv,mot); } // else mot already in list } } int main (int argc, char *argv[]) { if (argc < 2) { // text file is missing ? fprintf(stderr, "usage: hash \n"); } else { FILE *fp; fp=fopen(argv[1], "r"); if (fp==NULL) { fprintf(stderr, "no such file, or unreachable: %s\n", argv[1]); } else { Hashtable mylist; init_ht(mylist); load_ht(fp,mylist); } return 0; } }