Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #ifndef HACHAGE_STL_H
  2. #define HACHAGE_STL_H
  3. #include "HachageCommun.h"
  4. #include <iostream>
  5. #include <string>
  6. #include <stdexcept>
  7. #include <list>
  8. #include <vector>
  9. using namespace std;
  10. // déclaration des structures de données
  11. struct PersonneSimple
  12. {
  13.        string prenom;
  14.        string information;
  15. };
  16. struct PersonneTer
  17. {
  18.        PersonneSimple unePersonne;
  19.        bool libre;
  20.        list<PersonneSimple> listeCollisions;
  21. };
  22.  
  23. struct HachageSTL
  24. {
  25.        vector<PersonneTer> donnee;
  26. };
  27. /*----------------------------------------------------
  28. | Méthodes internes à la gestion de la table |
  29. ------------------------------------------------------*/
  30. // entraîne tous les postes de la table sont libres
  31. void initialiserHachageSTL(HachageSTL & table);
  32. // affichage du contennu de la table
  33. void afficher(const HachageSTL & table);
  34. /*----------------------------------------------------
  35. | Méthodes utilisables de la table |
  36. ------------------------------------------------------*/
  37. // test l'existence d'une clef donnée
  38. // appele chercher
  39. bool clefPresente(const HachageSTL & table, const string & clef);
  40. // cherche l'information associée à une clef si elle existe
  41. void chercher(const HachageSTL & table, const string & clef, bool & trouve, string & information);
  42. // ajoute à la table t, l’information et sa clef
  43. // nécessite non clefPrésente (t, clef)
  44. // déclenche clef déjà présente
  45. void inserer(HachageSTL & table, const string & clef, const string & info) throw (logic_error);
  46. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement