Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef HACHAGE_STL_H
- #define HACHAGE_STL_H
- #include "HachageCommun.h"
- #include <iostream>
- #include <string>
- #include <stdexcept>
- #include <list>
- #include <vector>
- using namespace std;
- // déclaration des structures de données
- struct PersonneSimple
- {
- string prenom;
- string information;
- };
- struct PersonneTer
- {
- PersonneSimple unePersonne;
- bool libre;
- list<PersonneSimple> listeCollisions;
- };
- struct HachageSTL
- {
- vector<PersonneTer> donnee;
- };
- /*----------------------------------------------------
- | Méthodes internes à la gestion de la table |
- ------------------------------------------------------*/
- // entraîne tous les postes de la table sont libres
- void initialiserHachageSTL(HachageSTL & table);
- // affichage du contennu de la table
- void afficher(const HachageSTL & table);
- /*----------------------------------------------------
- | Méthodes utilisables de la table |
- ------------------------------------------------------*/
- // test l'existence d'une clef donnée
- // appele chercher
- bool clefPresente(const HachageSTL & table, const string & clef);
- // cherche l'information associée à une clef si elle existe
- void chercher(const HachageSTL & table, const string & clef, bool & trouve, string &
- information);
- // ajoute à la table t, l’information et sa clef
- // nécessite non clefPrésente (t, clef)
- // déclenche clef déjà présente
- void inserer(HachageSTL & table, const string & clef, const string & info)
- throw (logic_error);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement